29

Some advocates of pair programming suggest that two software engineers working on a single feature together - at the same desk, at the same computer - will create software that is more correct - that is, closer to specification and more bug-free - than two solo developers.

One study I have seen cited is an investigation by Laurie Williams at the University of Utah, indicating a 15% reduction in bugs at the cost of 15% more man-hours to complete the story. Other sources suggest a figure of 30% either way, but I cannot find a source for these citations.

On the other hand, a 2007 Norwegian study involving around 300 professional developers indicated that pair programming did not have an appreciable benefit on quality and speed, but did have a strong negative effect on effort required.

What is the evidence here? Most of the papers I can find have either small sample sizes or an academic setting.

7
  • I added a link to the Wikipedia definition of Pair Programming, for a bit of context. The Wikipedia page has an informal survey of the literature, showing the different results, and a meta-analysis. Does that not fully answer your question?
    – Oddthinking
    Dec 17, 2014 at 0:10
  • 9
    A small correction: not all pair programming advocates taut correctness as the main advantage of pair programming. I've been advocating effective knowledge transfer as the main advantage for years.
    – Sklivvz
    Dec 17, 2014 at 13:37
  • 1
    A confounding factor is that pair programming is just one of several practices that are included within for example 'Extreme programming'.
    – ChrisW
    Dec 17, 2014 at 14:08
  • 3
    Almost everything is better with pair programming with the obvious exception that it requires a "pair" of programmers, rather than just one. Which for different reasons can be unavailable. Dec 17, 2014 at 19:48
  • I've had a look around and I can't find any comparative review of the studies. I doubt that this can be answered to your satisfaction right now -- you are right, there are a bunch of studies, most are positive, but no overall synthesis available.
    – Sklivvz
    Dec 20, 2014 at 15:06

1 Answer 1

4

I took a look at three different research works:

1. The Costs and Benefits of Pair Programming, by Alistair Cockburn and Laurie Williams, from University of Utah. Link to paper.

It seems the research metodology used was interviews as well as revisiting previous studies made in the univertisy, which se

Some of the conclusions, quoted from previews works (properly aknowledged) state that a "15% less defects" for every one thousand lines of code.

Significantly, the resulting code has about 15% fewer defects. (These results are statistically significant.) Figure 2 shows the post-development test cases the students passed for each program – essentially the percentage of the instructor’s test cases passed.

enter image description here

2. Effectiveness of PairProgramming:A Meta-Analysis (Hannay,Dyba,Arisholm and Sjøberg), from the University of Oslo, Norway. Link to paper

It uses a much more scientific approach, with systematic reviews and mata-analisys and has lots or charts and tables obtained after number crunching. It states in its conclusions that:

Pair programming may also have a time gain on simpler tasks. By cooperating, programmers may complete tasks and attain goals that would be difficult or impossible if they worked individually. Junior pair programmers, for example, seem able to achieve approximately the same level of correctness in about the same amount of time (duration) as senior individuals.

In the negative side:

3. Effective Pair Programming Practice - An Experimental Study (Yanamadala and Madina), Blekinge Tekniska Hogskola, Sweden. Link to paper

The main result of this study is that the pair programming practice used by the subjects, instead of solo programming, did not significantly affect branch coverage or mutation score indicator.


My personal experience is that PP does have a positive impact in code quality and/or correctness whenever the knowledge gap between programmers is not too big.

1
  • @spoderman I don't know whether it's typical, but my answer doesn't boil down to that. The important thing is the research works I quoted. Dec 23, 2014 at 20:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .