Will TDD really drive your design?

One of the most common arguments I've heard from TDD skeptics is that TDD does not drive your design. And this statement is both true and false.

One of the most common misconceptions about TDD in my opinion is that TDD stands for Test Driven Design. That is not the case. TDD stands for Test Driven Development. So TDD will not drive your design. It will however help you in your development work to make good decisions.

The confusing part is that some of your decisions during development are low level design decisions; how does each component interact with its dependencies and what does its interface look like. And it should! This article does a pretty good job of explaining this. The key point is that depending on how you name your tests, the resulting API of the unit under test will (or rather should) be different.

This is something I saw a lot in the past when I was doing coding dojos on a regular basis. Even though the same group of people solved the same problem several times, each time the implementation was different. After a while it was even possible to see how a single test written totally changed the direction of the implementation because its name implied a certain way to work with the code under test.

No comments:

Post a Comment