Skip to content
PMPCAPM

Pair Programming

Pair Programming is an XP practice where two developers work together at one workstation, with one writing code (the driver) and the other reviewing each line in real time (the navigator).

Explanation

In pair programming, the driver focuses on the tactical aspects of writing code while the navigator thinks strategically, reviewing for errors, considering edge cases, and thinking about the bigger picture. The roles are rotated frequently to keep both programmers engaged and to share knowledge.

Pair programming produces higher-quality code with fewer defects because every line is reviewed as it is written. It also accelerates knowledge transfer between team members, reduces the risk of knowledge silos, and helps onboard new team members quickly. While it may seem like two people doing one person's work, studies show that the reduced defect rate and improved design often offset the cost.

Pair programming is not meant for all tasks. Simple, routine tasks may not benefit from pairing, while complex, high-risk, or unfamiliar work benefits greatly. Teams should use judgment about when pairing adds value.

Key Points

  • Two developers at one workstation: driver writes code, navigator reviews
  • Produces higher-quality code with fewer defects
  • Accelerates knowledge sharing and reduces knowledge silos
  • Most beneficial for complex, high-risk, or unfamiliar work

Exam Tip

Pair programming is an XP practice focused on real-time code review and knowledge sharing. It is not a Scrum practice, though Scrum teams may adopt it.

Frequently Asked Questions

Related Topics

Test your knowledge

Practice scenario-based questions on this topic with detailed explanations.