the benefits of pair programming

18
CS 3500 L12pp - 1 The Benefits of Pair Programming Robert Kessler School of Computing University of Utah Special thanks to Laurie Williams North Carolina State University

Upload: celine

Post on 06-Jan-2016

32 views

Category:

Documents


0 download

DESCRIPTION

The Benefits of Pair Programming. Robert Kessler School of Computing University of Utah Special thanks to Laurie Williams North Carolina State University. What Is Pair Programming?. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: The Benefits of Pair Programming

CS 3500

L12pp - 1

The Benefitsof Pair Programming

Robert Kessler

School of Computing

University of Utah

Special thanks to

Laurie Williams

North Carolina State University

Page 2: The Benefits of Pair Programming

CS 3500

L12pp - 2

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."

Page 3: The Benefits of Pair Programming

CS 3500

L12pp - 3

This Is Pair Programming

Page 4: The Benefits of Pair Programming

CS 3500

L12pp - 4

This is NOT Pair Programming

Page 5: The Benefits of Pair Programming

CS 3500

L12pp - 5

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.

Page 6: The Benefits of Pair Programming

CS 3500

L12pp - 6

Does Pair Programming Really Work? 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

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

Page 7: The Benefits of Pair Programming

CS 3500

L12pp - 7

Post Development Test Cases Passed

0.0%10.0%20.0%30.0%40.0%50.0%60.0%70.0%80.0%90.0%

100.0%

Program 1 Program 2 Program 3 Program 4

Individuals

Collaborators

Findings #1 - Quality

Page 8: The Benefits of Pair Programming

CS 3500

L12pp - 8

Elapsed Time

0.0%

20.0%

40.0%

60.0%

80.0%

100.0%

120.0%

Program 1 Program 2 Program 3

One Individual One Collaborator

Findings #2 - Time

Page 9: The Benefits of Pair Programming

CS 3500

L12pp - 9

Enjoy the Work More Because of Pair Programming

0%

20%

40%

60%

80%

100%

PROF SUM1 SUM2 SUM3 FALL1 FALL2 FALL3

Agree Disagree

More Confident in our Work When Pair-Programming

0%

20%

40%

60%

80%

100%

PROF SUM1 SUM2 SUM3 FALL1 FALL2 FALL3

Agree Disagree

Findings #3 and #4 – Enjoyment and Confidence

Page 10: The Benefits of Pair Programming

CS 3500

L12pp - 10

How Does This Work?

Pair-Pressure– 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 all 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

Pair-Relaying– Each, in turn, contributes to the best of their knowledge and ability– Then, sit back and think while their partner fights on

Page 11: The Benefits of Pair Programming

CS 3500

L12pp - 11

How Does This Work (Part Two)?

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

Debug by describing– Tell it to the Furby

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

Page 12: The Benefits of Pair Programming

CS 3500

L12pp - 12

Research Findings to Date - 1 Strong anecdotal evidence from industry

– “We can produce near defect-free code in less than half the time.”

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%)

Page 13: The Benefits of Pair Programming

CS 3500

L12pp - 13

Research Findings - 2 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?

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

Page 14: The Benefits of Pair Programming

CS 3500

L12pp - 14

Issues: Workplace Layout

Bad Better

Best

Page 15: The Benefits of Pair Programming

CS 3500

L12pp - 15

Issues: Partner Picking Principles

Expert paired with an ExpertExpert paired with a Novice

Novices paired together Professional Driver Problem Culture

Page 16: The Benefits of Pair Programming

CS 3500

L12pp - 16

Issues: Pair Rotation

Ease staff training and transition

Knowledge management/Reduced product risk

Enhanced team building

Page 17: The Benefits of Pair Programming

CS 3500

L12pp - 17

Expected Benefits of Pair Programming

Higher product quality

Improved cycle time

Enhanced learning

Pair rotation– Ease staff training and transition

– Knowledge management/reduced product risk

– Enhanced team building

Increased programmer satisfaction

Page 18: The Benefits of Pair Programming

CS 3500

L12pp - 18

More Information

Bob [email protected]

Laurie [email protected]

http://pairprogramming.com http://collaboration.csc.ncsu.edu/laurie