Principles of Pair Programming
Email this Mix
Slide 1 - Principles of Pair Programming
- Emerson Murphy-Hill
- Creative Commons Attribution 4.0 License.
- Material Produced by NCSU Software Engineering Faculty.
Slide 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.”
- Laurie Williams, Pair Programming Illuminated.
- Driver: types or writes
- Navigator: observer (looking for tactical & strategic defects)
- Ongoing discussion about decisions
- Periodically switch roles of driver and navigator
- possibly every 30 minutes or less
- Pair coding, design, debugging, testing, etc.
Slide 3 - Process
- Used in eXtreme Programming
- Used in the Collaborative Software Process
- Pair programming can be added to any process
Slide 4 - 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
- 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 action
- Pair Courage
- “if it looks right to me and it looks right to you – guess what? It’s probably right!”
Slide 5 - How does this work (part two)?
- Pair Reviews
- “Four eyeballs are better than two”
- Continuous design and code reviews
- Removes programmers’ distaste for reviews
- Pair Debugging
- Explaining the problems to another person “Never mind; I see what’s wrong. Sorry to bother you.”
- Continuous reviews learn from partners techniques, knowledge of language, domain, etc.
- Take turns being the teacher and the student minute by minute