Are there any statistics available to
how much longer it will take to
develop applications when creating
unit test during the development
compared to just coding?
C'è una ricerca molto interessante su questo. Leggi il seguente white paper:
Realizzare il miglioramento della qualità attraverso il test guidato
sviluppo: risultati ed esperienze di quattro industriali
squadre
Il white paper e altre ricerche di uno dei suoi autori, Nachi Nagappan , sono discussi qui:
link
The study and its results were published in a paper entitled Realizing quality improvement through test driven development: results and experiences of four industrial teams, by Nagappan and research colleagues E. Michael Maximilien of the IBM Almaden Research Center; Thirumalesh Bhat, principal software-development lead at Microsoft; and Laurie Williams of North Carolina State University. What the research team found was that the TDD teams produced code that was 60 to 90 percent better in terms of defect density than non-TDD teams. They also discovered that TDD teams took longer to complete their projects—15 to 35 percent longer.
“Over a development cycle of 12
months, 35 percent is another four
months, which is huge,” Nagappan says.
“However, the tradeoff is that you
reduce post-release maintenance costs
significantly, since code quality is
so much better. Again, these are
decisions that managers have to
make—where should they take the hit?
But now, they actually have quantified
data for making those decisions.”
Inoltre, Jason Gorman ha ha proposto un esperimento di questo tipo per la conferenza di Software Craftsmanship quest'anno. Sta provando un esperimento per creare la stessa applicazione utilizzando un TDD e un approccio non TDD ed è recentemente bloggato sui suoi risultati :
Over 3 iterations, average time taken to complete the kata without TDD was 28m 40s. Average time with TDD was 25m 27s. Without TDD, on average I made 5.7 passes (delivering into acceptance testing). With TDD, on average I made 1.3 passes (in two attempts, they passed first time, in one it took 2 passes.)
Now, this was a baby experiment, of course. And not exactly laboratory conditions. But I note a couple of interesting things, all the same.
Sarà interessante vedere i risultati completi di questo esperimento quando più persone lo eseguono.
Are there any statistics available
that shows how many hours maintenance
decreases when having (good) unit
tests?
Dal whitepaper sopra:
The results of the case studies
indicate that the pre-release defect density of the four products decreased between 40% and
90% relative to similar projects that did not use the TDD practice.