Ted M. Young surveys academic papers regarding the pros and cons of Test Driven Development (TDD). Most papers come to the conclusion that TDD benefits or at least does not harm resulting code.
For future references, I like to highlight these two points:
First, Ted cites an article from the IEEE Software journal: “Does Test-Driven Development Really Improve Software Design Quality?”
Our results indicate that test-first programmers are more likely to write software in more and smaller units that are less complex and more highly tested.
Second, the cited survey paper “Towards an operationalization of test-driven development skills: An industrial empirical study” comes to this conclusion:
(i) refactoring is performed as often as TDD requires, and it is considered less important
(iv) participants first imagine the source code to be implemented and then write tests
we observed that developers tended to write more code than necessary to pass the unit test
To which Ted adds:
That last highlight is why TDD teachers harp on taking such small steps, because it’s so damned easy to write more code than is needed, thinking I know I’ll need to check for this condition later, so let me just write that code now, which not only “leaves part of the source code uncovered by tests” (from the conclusion above), because that’d be easily remedied by just writing some more tests, it’s that it may be the wrong design, as in, the code might be in the wrong place, it might not be the right code, etc., but you won’t know because you came at it from a code-first point of view.