The Benefits of Pair Programming Robert Kessler School
The Benefits of Pair Programming Robert Kessler School of Computing University of Utah Special thanks to Laurie Williams North Carolina State University CS 3500 1
What Is Pair Programming? "Pair programming is a simple, straightforward concept. Two programmers work side-by-side at one computer, continuously collaborating on the same design, algorithm, code, and test. It allows two people to produce a higher quality of code than that produced by the summation of their solitary efforts. " CS 3500 2
This Is Pair Programming CS 3500 3
This is NOT Pair Programming CS 3500 4
Pair Programming Has Been Around For a LONG TIME! 1945 . . . 1953 … 1997 1998 1999 2000 2001 2002 John von Neumann, recognized his own inadequacies and continuously asked others to review his work. Fred Brooks and many others are pair programming, though they don’t know there is a name for it. CS 3500 5
Does Pair Programming Really Work? l l Empirical study by Laurie Williams at the university of Utah Practice: Summer 1999 – 20 students (sophomore/junior) » All worked collaboratively – Generated more anecdotal/qualitative evidence l Solo vs. pair: Fall 1999 – 41 students (junior/senior) » 28 worked collaboratively » 13 worked individually – Software development process was controlled » The only experimental variable: pair-programming – Quantitative: time, quality, enjoyment, confidence CS 3500 6
Findings #1 - Quality CS 3500 7
Findings #2 - Time CS 3500 8
Findings #3 and #4 – Enjoyment and Confidence CS 3500 9
How Does This Work? l Pair-Pressure – – l Keep each other on task and focused Don’t want to let partner down “Embarrassed” to not follow the prescribed process Parkinson’s law “work expands to fill available time. ” Pair-Think – Distributed cognition: “searching through larger spaces of alternatives” » Have shared goals and plans » Bring different prior experiences to the task » Different access to task relevant information » Must negotiate a common shared of action l Pair-Relaying – Each, in turn, contributes to the best of their knowledge and ability – Then, sit back and think while their partner fights on CS 3500 10
How Does This Work (Part Two)? l Pair-Reviews – Continuous design and code reviews – Ultimate in defect removal efficiency – Removes programmers distaste for reviews » 80% of all (solo) programmers don’t do them regularly or at all l Debug by describing – Tell it to the Furby l Pair-Learning – Continuous reviews learn from partners techniques, knowledge of language, domain, etc. – “Between the two of us, we knew it or could figure it out” – Apprenticeship – Defect prevention always more efficient than defect removal CS 3500 11
Research Findings to Date - 1 l Strong anecdotal evidence from industry – “We can produce near defect-free code in less than half the time. ” l Empirical study – Pairs produced higher quality code » 15% less defects (difference statistically significant) » Observed – pairs produced smaller (LOC) programs – Pairs completed their tasks in about half the time » 58% of elapsed time (difference NOT statistically significant) – Most programmers reluctantly embark on pair programming » Pairs enjoy their work more (92%) » Pairs feel more confident in their work products (96%) CS 3500 12
Research Findings - 2 l Several educational studies underway – University of California, Santa Cruz; North Carolina State University – What about pair learning? » Anecdotal says that it works well – What are the long-term issues? » If you learn as a pair, can you work as a solo? l Distributed pair programming studies underway – North Carolina State University; University of North Carolina-Chapel Hill – Early results: distributed pair programming is viable – My experience: » Need to meet and know your pair » Need a good tool like VNC and telephone » Video not important CS 3500 13
Issues: Workplace Layout Bad Better Best CS 3500 14
Issues: Partner Picking Principles Expert paired with an Expert paired with a Novices paired together CS 3500 Professional Driver Problem Culture 15
Issues: Pair Rotation l Ease staff training and transition l Knowledge management/Reduced product risk l Enhanced team building CS 3500 16
Expected Benefits of Pair Programming l Higher product quality l Improved cycle time l Enhanced learning l Pair rotation – Ease staff training and transition – Knowledge management/reduced product risk – Enhanced team building l CS 3500 Increased programmer satisfaction 17
More Information l Bob Kessler 801 -581 -4653 kessler@cs. utah. edu l Laurie Williams 919 -513 -4151 williams@csc. ncsu. edu l http: //pairprogramming. com http: //collaboration. csc. ncsu. edu/laurie l CS 3500 18
- Slides: 18