Operations · Operations & process management

Pair programming

DRIVERNAVIGATORCODE

Use it when

Two developers can share one change, and you want it designed, written and reviewed together as it is built while knowledge spreads across the team.

Skip it when

  • The task is rote and needs no second view. Have one developer write it and send it through Code review process.
  • The two developers cannot find shared hours for the work. Use Code review process, which works without both people present.
  • You plan ping-pong pairing but the team does not yet write tests first. Start with Test-driven development (TDD), whose cycle ping-pong pairing runs on.

What to apply first and what to use instead are listed below.

Approaches

Driver and navigator

The driver types and talks through the current small goal, while the navigator reviews each line, watches the direction and notes larger issues for later.

  • Pro It suits any task and any mix of experience.
  • Con A confident driver can keep the keyboard and leave the navigator watching passively.

Ping-pong

One developer writes a failing test, the other makes it pass, then they swap and refactor together.

  • Pro The test cycle forces regular role swaps, so both stay engaged.
  • Con It needs a test-first habit and a test runner fast enough to run every few minutes.

Strong-style

The experienced developer navigates and the newcomer drives, so every idea passes through the newcomer's hands, and questions about why wait until a break.

  • Pro It is the quickest way to bring a newcomer up to speed on a codebase.
  • Con Kept up too long, it turns into micromanagement and stalls the newcomer's own thinking.

Inputs

  • Work item
    One story or task with its acceptance criteria, small enough to finish in a few sessions, from the team backlog.
  • Pair
    The two developers, the reason for pairing them, such as onboarding or a risky change, and which of them knows the code best.
  • Shared hours
    The hours both are free to pair this day, checked against each person's calendar and meetings.
  • Workstation setup
    One machine with a large screen and agreed editor settings, or screen sharing with remote control and headsets for a remote pair.
  • Rotation planOptional
    Who pairs with whom over the coming days, with one anchor who stays on each story.

Steps

  1. Agree the pairing hours, the style and the goal for the session, and say how each of you likes to work.
  2. Split the work item into small goals and write them on a shared list beside the screen.
  3. Work in timeboxes of about 25 minutes with short breaks, swapping driver and navigator at least at every break and narrating as you go.
  4. Park larger questions and ideas on the list while the driver finishes the current goal, then take them up at the next break.
  5. Integrate the finished change to the mainline with all tests passing, and open a short-lived pull request only where team rules require a separate review.
  6. Close with a short feedback round on how the pairing went, and rotate partners as planned, keeping one anchor on any unfinished story.

Output

A merged change written by the pair, with a short pairing record that shows how the session ran and what happens next.

  • Work item
  • Pair and anchor
  • Style used
  • Goals finished and questions parked
  • Merge or commit reference
  • Feedback agreed
  • Next partner or rotation

Done when

  • Both developers drove during the session, with a role swap at every break.
  • Every parked question is answered or added to the backlog with an owner.
  • The change is merged with all tests passing.
  • A feedback round was held and any agreed change to how the pair works is written down.
  • Every unfinished story has a named anchor for its next session.

Measure

For two to three months, track defects found after merge in paired changes, time from start to merge, and how many developers have worked on each main part of the code. Compare with your own unpaired changes from the months before. It worked when escaped defects fall, more people can change each part, and time to merge holds steady or improves.

Hypothetical example

Tomas joins the booking team at Fenwick Freight. For his first two days, Priya pairs with him strong-style on a new surcharge rule, navigating while he types. They work in 25-minute blocks and park questions about the pricing service on a sticky list. On day three they switch to ping-pong. Tomas writes a failing test for the weekend rate and Priya makes it pass, then they swap. The change merges with all tests green and no separate review. In the feedback round Tomas asks to drive more, so the next day he pairs with Joel in driver and navigator style, with Priya staying on as the story's anchor.

Common mistakes

  • One developer keeps the keyboard while the other watches. Swap roles at every break and have the driver say what they are doing.
  • Pairing all day without breaks. Work in timeboxes with short breaks, and cap pairing at about six hours a day.
  • Staying in strong-style after the newcomer is ready. Move to driver and navigator once they can lead small goals.
  • Rotating so often that every session starts with catching up. Keep one anchor on each story and rotate only as often as the context allows.
  • Forcing two people to pair while a conflict stands between them. Settle the issue first or choose a different partner.

Sources

Show all 4 sources

By company stage

  1. Pre-IdeaNot applicableThere is no code or developers while exploring problems.
  2. IdeaUsefulPairing helps a small team build an MVP and share knowledge, but is optional.
  3. Early StartupUsefulUseful for sharing context and quality as the team grows, though not required.
  4. StartupUsefulHelps onboard new engineers and spread knowledge across team leads.
  5. GrowthUsefulUsed selectively for complex work and mentoring across many engineers.
  6. ScaleUsefulTeams across products can pair on hard problems without it being mandatory.
  7. EnterpriseUsefulAdopted by some teams, but it is one practice among many.

Apply first

Nothing. You can start here.

Use instead

  • Code review process

    The task is rote and needs no second view. Have one developer write it and send it through Code review process.

  • Test-driven development (TDD)

    You plan ping-pong pairing but the team does not yet write tests first. Start with Test-driven development (TDD), whose cycle ping-pong pairing runs on.

Recommended resources

No sponsored resources on this framework yet. Sponsored listings would be labelled here, never in search.

Progress is not saved until you have an account. Create a free account