Pair Programming - a pratical guide

Post on 14-Apr-2017

53 views 1 download

transcript

Pair ProgrammingA practical guide

11/5/2016 – Giuseppe Sorrentino

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

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.

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.

Roles

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

Activity TimeFind the questions

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

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

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)

Activity TimePlus and delta

• Code quality• Speed

• Learning• Familiarization

Pair Programming Balance

Conclusion

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.

Thank you!