DEV Community

Discussion on: Does Test Driven Development Work?

Collapse
 
sweeneyb profile image
sweeneyb

Great post - it highlights a lot of what I've been grappling with over the past year.

"To me one of the biggest advantages (maybe the most under-appreciated advantage) of TDD is the design that it encourages." -- This has been my biggest takeaway (and thanks for putting it so eloquently). It's not enough to just write a bunch of tests that, once passing, will assure your feature will work. It's taking the opportunity to think about consumer usage and adapting your design to be simple, consistent, and easy to use. I wish I knew how to measure "better design" or its productivity gain or bug density reduction.

TDD has also helped me realize when I write code that isn't quite clear as it becomes hard to test. There may be a valid reason, but it triggers me to consider "are there separable concerns here? Can this be simpler?"

Disclosure: I've adopted something of a hybrid to TDD and ITL. I want awesome regression coverage, but I'm very much used to thinking in terms of solutions. For now, my test code tends to grow with my production code, informing the design and validating I'm addressing edge cases. We'll see if this is just a stopover on my way to TDD.

Thanks again - good read and very fair treatment.