Pair Programming - a pratical guide

14
Confidential - do not distribute Pair Programming A practical guide 11/5/2016 – Giuseppe Sorrentino

Transcript of Pair Programming - a pratical guide

Page 1: Pair Programming - a pratical guide

Pair ProgrammingA practical guide

11/5/2016 – Giuseppe Sorrentino

Page 2: Pair Programming - a pratical guide

Objective Present pair programming as agile practice

◦ Definition and Advantages◦ Roles and Duties

Provide clear and slick guidelines to improve pair programming within the pod◦ Restarting, Planning and Action◦ Tips and Tricks

Page 3: Pair Programming - a pratical guide

Definition“Pair programming is a dialog between two people trying to…understand how to program better.” 4

It integrates well into an agile environment because it allows: 1

• to produce better software by continuous inspection of code;• to foster face-to-face communication.

Page 4: Pair Programming - a pratical guide

Evidence 1Two programmers together vs. Two programmers alone

Two programmers together work more than twice as fast and think of more than twice as many solution to a problem as two working together.

Five experienced programmers individually vs. five couple of experienced programmers

Groups completed the task 40% more quickly and effectively by producing better algotithms and code in less time.

Page 5: Pair Programming - a pratical guide

Roles

Page 6: Pair Programming - a pratical guide

Duties

◦ Active role on the keyboard/mouse

◦ Focuses on the code at hand:◦ Syntax◦ Semantics◦ Algorithm

◦ Verbalise his thoughts

◦ Concentrates to pass the next test

Driver

◦ No active role on the keyboard mouse

◦ Continually reviews the work◦ Catches incidental mistakes◦ Anything which needs further verification◦ Overall code design

◦ Focuses on a strategic level◦ Checks the consistency of the code being written with existent code◦ Tracks if other changes are needed in different area of the code base◦ Suggest design and algorithm enhancements

Navigator

They switch often (from 10 to 20 minutes) only by swiping the keyboard

Page 7: Pair Programming - a pratical guide

Activity TimeFind the questions

Page 8: Pair Programming - a pratical guide

Example◦ In this case is better a multiple if structure or a switch

case?

◦ Which the most explicative name for this variable?

Driver

◦ How will this fit with the rest of the code?

◦ Will this implementation require changes elsewhere?

◦ Could we design this program better?

Navigator

Page 9: Pair Programming - a pratical guide

Restarting, Planning and Action 2

Research recognized three main phases:

• Restarting: when a couple is stuck

• Planning: when a couple is deciding on their next actions

• Action: when a couple is actively performing a task

Guideline to drive these phases are in the notes.

https://www.youtube.com/watch?v=ONnYCT_LJio

Page 10: Pair Programming - a pratical guide

Tips and Tricks 1,2,3,4

• Kill any distractor (browser, chats, notifications, etc.)

• Use an editor both are familiar with

• A good pairing time is four hours

• Do not pair to execute systematic and repetitive tasks

• Avoid to form always the same couples

• Check that your partner is active

• Healthy debate and avoid excess ego

• Use an appropriate workspace layout (switch keyboard)

Page 11: Pair Programming - a pratical guide

Activity TimePlus and delta

Page 12: Pair Programming - a pratical guide

• Code quality• Speed

• Learning• Familiarization

Pair Programming Balance

Conclusion

Page 13: Pair Programming - a pratical guide

References1. L. A. Williams and R. R. Kessler, “All I really need to know about pair programming I learned in kindergarten,”

Communications of the ACM, vol. 43, no. 5, pp. 108–114, 2000.

2. M. Zarb, J. Hughes, and J. Richards, “Evaluating industry-inspired pair programming communication guidelines with undergraduate students,” in Proceedings of the 45th ACM technical symposium on Computer science education, 2014, pp. 361–366.

3. L. Williams, R. R. Kessler, W. Cunningham, and R. Jeffries, “Strengthening the case for pair programming,” IEEE software, vol. 17, no. 4, pp. 19–25, 2000.

4. M. Kircher, P. Jain, A. Corsaro, and D. Levine, “Distributed extreme programming,” Extreme Programming and Flexible Processes in Software Engineering, Italy, pp. 66–71, 2001.

Page 14: Pair Programming - a pratical guide

Thank you!