Скачать презентацию Pair Programming Why Have Two Do the Work Скачать презентацию Pair Programming Why Have Two Do the Work

91b00a5fa907106e008167362152af6e.ppt

  • Количество слайдов: 40

Pair Programming: Why Have Two Do the Work of One from Laurie Williams North Pair Programming: Why Have Two Do the Work of One from Laurie Williams North Carolina State University

Pair Programming Pair Programming

Agenda Ø Research/Findings Ø Colocated Pairs Ø Distributed Pairs Ø Pair Interactions Ø Sample Agenda Ø Research/Findings Ø Colocated Pairs Ø Distributed Pairs Ø Pair Interactions Ø Sample Pairings Ø Pair Rotation Ø Summary

Empirical Study for Validation Ø Practice: Summer 1999 Ø 20 Students (Sophomore/Junior) Ø All Empirical Study for Validation Ø 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

Boxplot of Program Quality Boxplot of Program Quality

Boxplot of Student Time Boxplot of Student Time

Collaboration by Phase Collaboration by Phase

Distributed Pair Programming Ø Ø Ø Ø Net Meeting Yahoo Messenger Graduate Object-Oriented class Distributed Pair Programming Ø Ø Ø Ø Net Meeting Yahoo Messenger Graduate Object-Oriented class at NCSU 5 -week project 132 students 34 distance students Teams of 2 -4 students Ø Colocated non-pairs (9 groups) Ø Colocated pairs (16 groups) Ø Distance non-pairs (8 groups) Ø Distance pairs (5 groups)

Productivity Productivity

Quality Quality

Satisfaction with Working Arrangement V e r y g o o d G F Satisfaction with Working Arrangement V e r y g o o d G F o a o i d r P o o r Non 4 4 1 3 pair 6 0 1 % colo % % % cated Pair 6 2 1 0

Satisfaction with Communication V e r y g o o d G F o Satisfaction with Communication V e r y g o o d G F o a o i d r P o o r Non 5 2 1 6 pair 7 6 1 % colo % % % cated Pair 5 2 1 2

Research Findings to Date Ø Strong anecdotal evidence from industry “We can produce near Research Findings to Date Ø 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) – 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%) – Distributed pair programming is a viable alternative (worthy of much more research)

How does this work? Ø Pair-Pressure Ø Keep each other on task and focused 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 available time. ” Ø Pair-Negotiation Ø 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

How does this work (part two)? 1. Pair-Reviews 1. Continuous design and code reviews How does this work (part two)? 1. Pair-Reviews 1. Continuous design and code reviews 2. Ultimate in defect removal efficiency 3. Removes programmers distaste for reviews 1. 80% of all (solo) programmers don’t do them regularly or at all 2. Debug by Describing 1. Tell it to the Furby 3. Pair-Learning 1. Continuous reviews learn from partners techniques, knowledge of language, domain, etc. 2. “Between the two of us, we knew it or could figure it out” 3. Apprenticeship 4. Defect prevention always more efficient than defect removal

Vending Machine Program: Responsibility Assignment UI Mary Machine Maintenance Sue Buy Drink Joe Data Vending Machine Program: Responsibility Assignment UI Mary Machine Maintenance Sue Buy Drink Joe Data Structures Charlie

Task Joe UI for ‘Add Inventory’ Mary Sue Joe Mary Joe Charlie Ingredient Data Task Joe UI for ‘Add Inventory’ Mary Sue Joe Mary Joe Charlie Ingredient Data Structure Charlie Sue Recipe Data Structure Mary Select Drink Buy Drink UI for ‘Buy Drink’ Input Coins/Return Coins UI Partner UI for ‘Add Recipe’ Pair Rotation Owner Charlie Sue Add Ingredients Sue Charlie Customer Analysis Sue Mary Joe Mach Maint. Data Struct. Sue Charlie

Expected Benefits of Pair. Programming Ø Ø Ø Higher product quality Improved cycle time Expected Benefits of Pair. Programming Ø Ø Ø Higher product quality Improved cycle time Increased programmer satisfaction Enhanced learning Pair rotation Ø Ease staff training and transition Ø Knowledge management/Reduced product risk Ø Enhanced team building

The Benefits of Pair Programming Robert Kessler School of Computing University of Utah Special 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? 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. "

This Is Pair Programming This Is Pair Programming

This is NOT Pair Programming This is NOT Pair Programming

Pair Programming Has Been Around For a LONG TIME! 1945 . . . 1953 Pair Programming Has Been Around For a LONG TIME! 1945 . . . 1953 … 1997 1998 1999 2000 2001 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. 2002

Does Pair Programming Really Work? Empirical study by Laurie Williams at the university of Does Pair Programming Really Work? Empirical study by Laurie Williams at the university of Utah l Practice: Summer 1999 l – 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

Findings #1 - Quality Findings #1 - Quality

Findings #2 - Time Findings #2 - Time

Findings #3 and #4 – Enjoyment and Confidence Findings #3 and #4 – Enjoyment and Confidence

How Does This Work? l Pair-Pressure – – l Keep each other on task 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

How Does This Work (Part Two)? l Pair-Reviews – Continuous design and code reviews 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

Research Findings to Date - 1 l Strong anecdotal evidence from industry – “We 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%)

Research Findings - 2 l Several educational studies underway – University of California, Santa 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

Issues: Workplace Layout Bad Better Best Issues: Workplace Layout Bad Better Best

Issues: Partner Picking Principles Expert paired with an Expert paired with a Novices paired Issues: Partner Picking Principles Expert paired with an Expert paired with a Novices paired together Professional Driver Problem Culture

Issues: Pair Rotation l Ease staff training and transition l Knowledge management/Reduced product risk Issues: Pair Rotation l Ease staff training and transition l Knowledge management/Reduced product risk l Enhanced team building

Issues: Process l Used in e. Xtreme Programming l Used in the Collaborative Software Issues: Process l Used in e. Xtreme Programming l Used in the Collaborative Software Process l Pair programming can be added to any process

Expected Benefits of Pair Programming l Higher product quality l Improved cycle time l 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 Increased programmer satisfaction

More Information l Bob Kessler 801 -581 -4653 kessler@cs. utah. edu l Laurie Williams 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