Issue No.02 - March/April (2008 vol.25)
pp: 77-84
David Janzen , California Polytechnic State University, San Luis Obispo
Hossein Saiedian , University of Kansas
Test-driven development (TDD) is first and foremost a design practice. The question is, "How good are the resulting designs?" Advocates claim that TDD produces code that is simpler, more cohesive, and less coupled than code developed in a more traditional test-last way. Sounds good, but is it true? We collected evidence to substantiate or question the claims regarding TDD's influence on software. We focused on internal software quality?that is, design and code characteristics such as code complexity, size, coupling, and cohesion. We conducted three quasicontrolled experiments and one case study in a Fortune 500 company and another two quasicontrolled experiments with university students in undergraduate and graduate software engineering courses. We evaluated 24 student and professional programmers working on 21 software projects ranging in size from a few hundred to over 30,000 lines of code. The results indicate that TDD programmers tend to write software modules that are smaller, less complex, and more highly tested than modules produced by their test-last counterparts. However, the results didn't support claims for lower coupling and increased cohesion with TDD.
test design, test-driven development, TDD, software design, software architecture, quality analysis, quality metrics
David Janzen, Hossein Saiedian, "Does Test-Driven Development Really Improve Software Design Quality?", IEEE Software, vol.25, no. 2, pp. 77-84, March/April 2008, doi:10.1109/MS.2008.34
1. R.C. Martin, Agile Software Development: Principles, Patterns, and Practices, Pearson Education, 2003.
2. K. Beck, "Aim, Fire," IEEE Software, Sept./Oct. 2001, pp. 87–89.
3. D. Janzen and H. Saiedian, "Test-Driven Development: Concepts, Taxonomy, and Future Direction," Computer, Sept. 2005, pp. 43–50.
4. B. George and L. Williams, "A Structured Experiment of Test-Driven Development," Information and Software Technology, vol. 46, no. 5, 2004, pp. 337–342.
5. H. Erdogmus, M. Morisio, and M. Torchiano, "On the Effectiveness of the Test-First Approach to Programming," IEEE Trans. Software Eng., vol. 31, no. 3, 2005, pp. 226–237.
6. A. Geras, M. Smith, and J. Miller, "A Prototype Empirical Evaluation of Test Driven Development," Proc. 10th Int'l Symp. Software Metrics (Metrics 04), IEEE CS Press, 2004, pp. 405–416.
7. M.M. Müller, "The Effect of Test-Driven Development on Program Code," Proc. Int'l Conf. Extreme Programming and Agile Processes in Software Eng. (XP 06), Springer, 2006, pp. 94–103.
8. P. Kruchten, The Rational Unified Process: An Introduction, 3rd ed., Addison-Wesley, 2003.
9. L.C. Briand, J.W. Daly, and K. Wüst, "A Unified Framework for Coupling Measurement in Object-Oriented Systems," IEEE Trans. Software Eng., vol. 25, no. 1, 1999, pp. 91–121.
10. L. Briand, J. Daly, and J. Wüst, "A Unified Framework for Cohesion Measurement in Object-Oriented Systems," Empirical Software Eng., vol. 3, no. 1, 1998, pp. 65–117.
11. D. Janzen and H. Saiedian, "A Leveled Examination of Test-Driven Development Acceptance," Proc. 29th Int'l Conf. Software Eng. (ICSE 07), IEEE CS Press, 2007 pp. 719–722.
12. M. Fowler, "Inversion of Control Containers and the Dependency Injection Patterns," 2004; .
13. R. Johnson et al., Java Development with the Spring Framework, Wrox, 2005.
14. B. Henderson-Sellers, Object-Oriented Metrics: Measures of Complexity, Prentice Hall, 1996.