Are you any good at TDD?

Daniel Irvine šŸ³ļøā€šŸŒˆ - Feb 16 '20 - - Dev Community

Cover image by Isaac Smith on Unsplash

In my last post I talked about code coverage and its usefulness as an educational milestone for any aspiring developer to conquer.

I finished the post by saying that experienced TDD practitioners have little need for code coverage because they will be hitting 100% coverage by the very nature of their development process.

But unfortunately for us, we have no good metric for measuring how effective we are with TDD.

Software design itself is fairly subjective, so thatā€™s one reason why we donā€™t have a good measurement. None of us can agree.

If youā€™re a TDD practitioner, how do you know youā€™re any good?

The old ā€œI donā€™t need code coverage because I do TDDā€ excuse

Itā€™s been a long time since I bothered to use code coverage metrics as part of my regular development process. (To be clear, there are times when I do use code coverage--to verify coverage of a unit that I didnā€™t write, and to check how Iā€˜m doing when Iā€™m using test-after with legacy code.)

When I have clients ask me why I donā€™t bother with code coverage, I tell them I follow ā€œstrictā€ TDD so I donā€™t need it.

But itā€™s an excuse. I say this because people trust me that when I say it. They think itā€™s true, a fact. But of course itā€™s not. I say it because Iā€™m lazy and code coverage it just one of those things that very rarely helps me in my day-to-day. And itā€™s mostly true.

But what happens if Iā€™m having an off-day, or Iā€™m in a rush?

What happens if I make accidental mistakes in my tests?

What keeps me honest?

More to the point, how do I know that Iā€™m writing good tests, and how do I know Iā€™m any good at software design in general?

I donā€™t really have the answer to that. Thereā€™s only one way I know that really helps: working with others.

Keeping yourself honest by working with others

Pairing, and mobbing, helps you follow the TDD cycle religiously. It goes some way to stop you slipping up, cutting corners, making mistakes. Plus, itā€™ll improve your software design.

It can help with building the right thing, too. When you mob you might have the opportunity to include a QA person within the mob. With any luck, theyā€™ll have some input on what requirements you may be missing.

Then, as the mob signs-off work, everyone involved should be able to say they they believe they tested everything to the best of their ability.


If you have any of your own ideas about how to measure your TDD skills, Iā€™d love to hear them.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player