What Makes Better Code?
November 9, 2009 ·
As you might guess from some of my tweets and blog posts lately, I've been reading more about Agile, Lean and XP software processes, looking at how I can improve my own working practices and those of the teams I work with.
Once again the XP mailing list has provided a good read with a link to large-scale research at Microsoft
into the effectiveness of certain software practices. As the researcher points out, the vast scale and diversity of Microsoft's software development ecosystem allows for some in-depth analysis that compares different approaches on similar teams.
The article is worth reading all the way through and shouldn't really contain any surprises but there are a couple of things I wanted to pull out and highlight.Test-Driven Development
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.
Neither of these findings should be surprising but it's good to actually have numbers you can point your managers at when arguing in favor of TDD!
Organizational metrics, which are not related to the code, can predict software failure-proneness with a precision and recall of 85 percent. ... This was probably the most surprising outcome of all the studies.
OK, this one surprised me! Not that organization affects project success or failure but that the predictive correlation was so high. This is one case study you bet I'm going to read cover-to-cover!
The article also has a section on distributed teams but it bases its findings only on degrees of distribution and doesn't include a comparison of the XP practice of having the team in the same room, working around a table together which some studies have shown improves productivity by as much as a factor of two (I'll blog more about this once I've assimilated those studies in more detail). The article concludes that the degree of distribution has less impact than organizational cohesiveness (see above) and that's not really surprising. I've worked in "War Room" style environments and the productive can go up dramatically even compared to developers all being in relatively open cubes on the same floor of a single building.
Tags: programming · tdd