A recent post by William Pietri on the XP list caught my eye:
Alas, I don’t have the data Brad is looking for on requirements gathering, but I did just happen to come up with some data on that eternal novice XP question: Doesn’t writing all of that test code slow you down?
I just ran the code from a previous project through LOCC:
This is from a pure XP project, a Java-based web application. Total lines of code:
Prod: 34961 LOC
Test: 35176 LOC
I haven’t checked exactly, but this was about four developers for 8 or 9 months. Looking at numbers from Steve McConnell’s Rapid Development, and assuming that web applications are more or less like shrink-wrap apps, he has three sets of schedule numbers for 35 kLOC:
shortest possible: 7 months 44 developer-months
efficient: 10 months 39 developer-months
nominal: 12 months 71 developer-months
So counting only production code, we did well, slightly beating the efficient schedule. But what if we count the test code? At 70 kLOC, the numbers look like this:
shortest possible: 9 months 120 developer-months
efficient: 13 months 100 developer-months
nominal: 16 months 175 developer-months
So assuming McConnell’s numbers are in the ballpark, there are two possibilities. Either we were two or three times as good as the best teams in the source data, or test code is essentially free. Personally, I think it’s the latter.