Pair Programming Cheat Sheet

Pair Programming is very powerful and often very misunderstood. I highly recommend reading Pair Programming Illuminated as a starting point. As you begin to get a feel for pairing, review the tips below. They’re a combination of ideas from Pair Programming Illuminated and my own personal experiences pairing on production code for multiple internal projects and customer-facing products over several years.

Pair Programming Tips

The 7 Synergistic Behaviors

Observe that your getting the most out of the seven Synergistic Behaviors:

  1. Pair Pressure – Positive encouragement = not wanting to let partner down + satisfaction of working harder & smarter than you would alone
  2. Pair Negotiation – Combining two sets of skills for design & implementation to yield the best solution that fits
  3. Pair Courage – Advantage of not being alone in a challenging task, trying together what you might not alone
  4. Pair Review – Continuous review of design & implementation that happens in context and is more likely to be acted upon
  5. Pair Debugging – Going from problem identification to fix in a more enjoyable and often far shorter way than an individual might do it
  6. Pair Learning – Acquiring and/or improving skills while delivering value through working with another
  7. Pair Trust – Becoming more confident in each other’s skills and communication to present the best ideas because they feel supported

If you find these synergies are weak or lacking, reflect on what you can do to improve your pairing experiences.

Pairing Games

Ping Pong

Typically for Test Driven Development

  1. Driver creates test class and/or initial failing test with navigators’ help.
  2. Switch roles!
  3. New driver makes test pass with new navigators’ help.
  4. Pair negotiates possible refactoring and code check-in, and executes it if they are agreed.
  5. Repeat until you need a break.

Beat the Clock

A good way to enforce pace and limit keyboard hogs

  1. Grab a physical or virtual timer (Smart Phone, System Tray Application, etc.).
  2. Decide who will be the driver first.
  3. Set the timer & let the driver get as far as they can with the navigators’ help.
  4. Switch driver & navigator.
  5. Repeat until you need a break.

Freeform

For advanced pairing practitioners

Someone starts driving, then the pair switches roles as needed, so long as Synergies don’t stop.

Pairing Script

  1. Decide on a Story & Task.
  2. Decide initially on how much you want to pair (time spent and/or progress).
  3. Decide initially on a Pairing Game to use.
  4. Play your Pairing Game.
  5. Decide to continue (goto #1), switch pairs, or stop.

Pairing Dialogue

Try the following:

Say “I think…” to propose an idea.
Ask “Do we agree…” to confirm agreement.
Say “We agree…” to discuss progress towards goals.
Avoid saying “No, but…” Instead try saying, “Yes and…”
Ask “What would it take to get you in…” if your pair disagrees with a proposed idea.

The 4 “C”’s

  1. Communication: Do you agree you’re both communicating well with each other?
  2. Comfort: Are you two both comfortable with the context you’re working in?
  3. Confidence: Are you confident in your skills and your teams’, or at least voiced fears?
  4. Compromise: Are you willing to make compromises in order to make progress?

Pairing Mechanics

  1. Turn on line numbers in an IDE or text editor if available. It makes it easier for the navigator and driver both to reference sections of code in discussion.
  2. ASK for mouse/keyboard control, don’t fight!
  3. Remember to point with your mouse, not at the screen when using mirrored monitors.
  4. Remote pairing should not only be desktop sharing & voice. A significant portion of human communication is nonverbal, so add video chat to your tools.

Like this? You’ll love Agile Eats

Subscribe to Agile Eats
Stay on top of the latest Agile tips, trends and techniques with Agile Eats. Great for new Agilists eager to get learning. Subscribe now and receive weekly tips for your Agile Teams!
*By entering your email address you give SolutionsIQ permission to send you marketing emails. You may unsubscribe at any time by clicking the unsubscribe link located at the bottom of any email. View our Privacy Policy