Skip to content
GabineteTools for thinking

No. 2043Learning, coaching and goal setting

Pair Programming

Williams and (research) · 1999

Two brass arms on the same axis: a needle sews bluish green thread and a magnifying glass behind detects a failure marked with red pin.

The table / Model card · No. 2043 · Learning, coaching and goal setting

Pair Programming

Two people, one task, one keyboard: one writes, one reviews and steers, and they swap often.

Also known as Buddy Code Rotation · Empathy Pair Programming · Hero-Helper Pairing · Quick Switch Pairing · Split-Level Pairing · Weighted Remote Pair Programming Ladder · and 1 more

The essentials

What it is

What it solves

How do you catch design and coding mistakes while they are being made, and spread knowledge of a codebase so it does not live in one head?

When to use it

Use it for complex or unfamiliar code, risky changes, onboarding new team members, spreading knowledge of critical modules, and hard debugging sessions.

Where it comes from

Programmers worked in pairs before XP, so there is no single inventor. Kent Beck's team paired on the Chrysler payroll project from 1996, and Beck made pairing a core practice in Extreme Programming Explained (1999). Laurie Williams, Robert Kessler and colleagues then published experiments and the 2002 book Pair Programming Illuminated. The 1999 year marks popularisation, not invention.

Kent Beck, Laurie Williams and Robert Kessler · 1999

How it works

Pairing splits attention between two levels. The driver focuses on the line being written; the navigator, free of the keyboard, holds the bigger picture: the design, the next test, the edge case. Continuous review finds defects seconds after they are introduced, when they are cheapest to fix. Talking through choices forces reasoning to be explicit, which tends to produce simpler designs. Rotating partners spreads knowledge of the code and conventions across the team, reducing dependency on single experts. The cost is two people on one task, so the gain depends on task difficulty and pair composition.

You need

Two developers, a shared workstation or screen-sharing tool, a well-defined task, and an agreement on role switching.

You get

Code reviewed as it is written, shared understanding of the change, and fewer defects reaching later review and testing.

Case

Illustrative case

Quayside Bank's fictional mobile team must rewrite its card-freeze feature, touching a fraud service only one senior engineer knows. For three weeks she pairs with two colleagues in rotation, swapping driver and navigator every 25 minutes. The feature ships with 3 defects found in test, against a team average of 9 for changes of similar size. Afterwards, two more engineers can change the fraud service, and on-call escalations to the senior engineer drop from 6 to 2 per month.

A fictional company used to explain the model.

Caution

When to avoid it

  • Avoid it for routine, well-understood tasks where a second person adds little, when the two people are both novices without support, or when it is imposed for whole days without breaks and causes fatigue.

Common mistakes

  • Letting one person drive all session while the other watches passively.
  • Pairing an expert with a novice without making the novice drive.
  • Pairing all day without breaks.
  • Using pairing as a substitute for tests.
  • Measuring only lines of code per person and calling pairing wasteful.

Known weaknesses

  • Costs more person-hours, especially on simple tasks.
  • Benefits vary with expertise and task complexity.
  • Can be tiring and socially demanding.
  • Research evidence is mixed and shows signs of publication bias.

How to apply it in 6 steps

How to apply it

Pair Programming

6 steps

Use the arrow keys to move between steps, Home and End for the first and last, and Enter to fold or unfold the booklet.

View all 6 steps
  1. Pick a suitable task

    Choose work that is complex, risky or unfamiliar enough to benefit from two minds.

  2. Agree roles and rhythm

    Decide who drives first and set a switching interval, for example every 25 minutes or every passing test.

  3. Drive and navigate

    The driver writes code and explains intent; the navigator reviews, asks questions and tracks the plan.

  4. Switch roles

    Swap at the agreed interval so both stay engaged and both touch the code.

  5. Rotate partners

    Change pairs across days or stories to spread knowledge across the team.

  6. Reflect

    End with a short check on what worked and what to adjust in the next session.

Which decisions it helps with

Decision profile

A tool to take action on processes and operations.

Keyboard: Tab to the sheet, use the arrows to explore the assessments and their questions, and press Escape to close the note.

IIdentity

Type of tool
Other formatDoes not fit neatly into the available categories
Decision stage
Plan the work, roles and deadlines
What it applies to
Processes and operations
Discipline
Agile and software development

IIIResources required

  • TimeBetween “several days” and “weeks or months”
  • PeopleA small group (2 to 8)
  • DataNone: experience is enough
  • ExpertiseAnyone who has read a page of instructions
  • Time horizonDays or weeks
  • ScopeOne team
  • FrequencyOccasionally
The team’s own knowledge is enough

IITen axes

The dot shows which end the model favours. A hollow dot means no clear preference.

  • DirectionExecution
  • Top-downBottom-up
  • PeopleProcesses
  • Generate optionsNarrow down options
  • Step-by-step analysisIntuition and experience
  • A strict sequence of stepsA flexible framework
  • Protect what we haveTake a risk
  • Improve what we haveFundamental change
  • Inside the organisationOutside the organisation
  • Understand firstAct now

IVUseful when

Applicable traits

  • How it supports actionClarify who does what
How was this profile calculated?

An automated system reads each model card and answers the same questions for every model. This profile has answers for 77 of 77. No answers are entered by hand.

A very high probability counts as “yes” and a very low one as “no”. Intermediate answers are hidden.

On the axes, mixed means the model favours neither end.

How it works →

Thinking space

Learning, coaching and goal setting

They make people grow: coaching (GROW), goals and measures of advancement, training and skills development.

Membership: 24 % · also “Workflow and delivery” (24 %)

View in the atlas of spaces →

Each point is a model. Distance reflects answers to the decision questions. Light points share this model’s space.

Similar models

Verified sources

Use the arrow keys to move between sources.

Original work

  1. Beck, K. (1999). Extreme Programming Explained: Embrace Change. Addison-Wesley Professional.Book that made pair programming a core XP practice. Publisher page shows title, 'By Kent Beck', published Oct 5, 1999 by Addison-Wesley Professional, ISBN-13 978-0-201-61641-5.View source: Extreme Programming Explained: Embrace Change (opens in a new tab) ↗

Key development

  1. Williams, L., Kessler, R. R., Cunningham, W. and Jeffries, R. (2000). Strengthening the case for pair programming. IEEE Software, 17(4), 19-25.Early empirical study of pair programming quality and effort. Crossref record shows title, four authors, IEEE Software vol. 17, pp. 19-25, 2000.View source: Strengthening the case for pair programming (opens in a new tab) ↗

Critique

  1. Hannay, J. E., Dyba, T., Arisholm, E. and Sjoberg, D. I. (2009). The effectiveness of pair programming: A meta-analysis. Information and Software Technology, 51(7), 1110-1122.Meta-analysis finding that pairing is not uniformly beneficial and that effects depend on task complexity and expertise. Crossref record confirms title, authors, journal and 2009.View source: The effectiveness of pair programming: A meta-analysis (opens in a new tab) ↗

Practical guide

  1. Williams, L. and Kessler, R. (2002). Pair Programming Illuminated. Addison-Wesley Professional.Book-length treatment of how to pair, pair combinations and pitfalls. Publisher page shows 'By Laurie Williams, Robert Kessler', published Jun 28, 2002, ISBN-13 978-0-201-74576-4.View source: Pair Programming Illuminated (opens in a new tab) ↗

Wikipedia article (opens in a new tab) ↗