On the effectiveness of the test-first approach to programming

Test-driven development (TDD) is based on formalizing a piece of functionality as a test, implementing the functionality such that the test passes, and iterating the process. This paper describes a controlled experiment for evaluating an important aspect of TDD: in TDD, programmers write functional tests before the corresponding implementation code. The experiment was conducted with undergraduate students. While the experiment group applied a test-first strategy, the control group applied a more conventional development technique, writing tests after the implementation. Both groups followed an incremental process, adding new features one at a time and regression testing them. We found that test-first students on average wrote more tests and, in turn, students who wrote more tests tended to be more productive. We also observed that the minimum quality increased linearly with the number of programmer tests, independent of the development strategy employed.

[1]  Jacob Cohen Statistical Power Analysis for the Behavioral Sciences , 1969, The SAGE Encyclopedia of Research Design.

[2]  Claes Wohlin,et al.  Experimentation in software engineering: an introduction , 2000 .

[3]  Dave Astels,et al.  Test Driven Development: A Practical Guide , 2003 .

[4]  Kent L. Beck,et al.  Test-driven Development - by example , 2002, The Addison-Wesley signature series.

[5]  Hakan Erdogmus,et al.  The Role of Process Measurement in Test-Driven Development , 2004, XP/Agile Universe.

[6]  P. Cederqvist,et al.  Version Management with CVS , 1993 .

[7]  Adam A. Porter,et al.  Comparing Detection Methods For Software Requirements Inspections: A Replication Using Professional Subjects , 1998, Empirical Software Engineering.

[8]  P. Lachenbruch Statistical Power Analysis for the Behavioral Sciences (2nd ed.) , 1989 .

[9]  Kent L. Beck,et al.  Extreme programming explained - embrace change , 1990 .

[10]  Claes Wohlin,et al.  Using Students as Subjects—A Comparative Study of Students and Professionals in Lead-Time Impact Assessment , 2000, Empirical Software Engineering.

[11]  Kent Beck,et al.  Test-infected: programmers love writing tests , 2000 .

[12]  Laurie A. Williams,et al.  Assessing test-driven development at IBM , 2003, 25th International Conference on Software Engineering, 2003. Proceedings..

[13]  Barry Boehm,et al.  Top 10 list [software development] , 2001 .

[14]  Miroslav Novak,et al.  A Practical Guide to eXtreme Programming , 2002 .

[15]  Harlan D. Mills,et al.  Cleanroom Software Engineering , 1987, IEEE Software.

[16]  Walter F. Tichy,et al.  Case study: extreme programming in a university environment , 2001, Proceedings of the 23rd International Conference on Software Engineering. ICSE 2001.

[17]  Per Runeson,et al.  Using Students as Experiment Subjects – An Analysis on Graduate and Freshmen Student Data , 2003 .

[18]  Frank Maurer,et al.  On the Productivity of Agile Software Practices: An Industrial Case Study , 2002 .

[19]  Matthias M. Müller,et al.  Experiment about test-first programming , 2002, IEE Proc. Softw..

[20]  H. B. Mann,et al.  On a Test of Whether one of Two Random Variables is Stochastically Larger than the Other , 1947 .

[21]  Als-Nscort Eclipse Platform Technical Overview , 2003 .

[22]  Richard C. Linger,et al.  Cleanroom software engineering for zero-defect software , 1993, Proceedings of 1993 15th International Conference on Software Engineering.

[23]  Boby George,et al.  An initial investigation of test driven development in industry , 2003, SAC '03.