The effectiveness of TDD
Some researchers from North Carolina State University have done a small study on Test-Driven Development and published their results: http://collaboration.csc.ncsu.edu/laurie/Papers/TDDpaperv8.pdf
[Via Jeffry Palermo]
Note this was a
small study. It was with 24 professional pair programmers.
Results:
A series of experiments were conducted to examine the TDD
practice. Specifically, the following hypotheses were tested and
corresponding conclusions were obtained, subject to the limitations
of the study:
- TDD approach appears to yield code with superior external
code quality, as measured by conformance to a set of black
box test cases when compared with code developed with a
more traditional waterfall-like model practice.
- The experiment results showed that TDD developers took
more time (16%) than control group developers. However, the
variance in the performance of the teams was large and these
results are only directional. Additionally, the control group pairs
did not primarily write any worthwhile automated test cases
(though they were instructed to do so), making the comparison
uneven.
- On an average, 80% of the professional developers held that
TDD was an effective approach and 78% believed the
approach improves programmers’ productivity. The survey
results are statistically significant.
- Qualitatively, this research also found that TDD approach
facilitates simpler design and that lack of upfront design is not
a hindrance. However, for some, transitioning to the TDD
mindset is difficult.
These results need to be viewed within the limitations of the
experiments conducted. Further controlled studies on a larger scale
in industry and academia could strengthen or disprove these
findings.