Pair Practice

Goal: Get a feeling for pair programming (without any programming).

Time: 20-30 minutes.

Introduction: Pair programming is two programmers working together at one terminal on one task.

Think of a good pair driving across the country. One will drive, the other navigate (thinking tactically and strategically). They'll take turns. They'll pay attention to each other's mood. They'll take a break when they need to. A good programming pair is like this.

This exercise conveys some of the feel of what it's like to be a programming pair.

Material:

  • List of tasks.
  • Two skill cards (face down).
    Card A: Good at spinning left. Bad at head patting.
    Card B: Good at head/shoulders/knees/toes, bad at chrysanthemum.

Setup:

  • Divide into pairs; decide who is programmer 1 and who is programmer 2.
  • Give each programmer a skill card to memorize; a programmer shouldn't show their skills to the other programmer. (Thus, if programmer 1 has card A, programmer 2 will have card B.)

Play:

  • If you're the actor on a task: close your eyes, do the task, then stand normally, and say, "OK."
  • Keep the task list out of reach and out of "reading range" for the actor.
  • Work through the list, with one or the other programmer being the actor doing each task.
  • If a task is on the non-actor's "good skill" list, that person should say "May I drive?" and do the task.
  • If a task is on the actor's "bad skill" list, that person should say "Would you drive?" and let the other do the task.
  • Don't be the actor for more than three tasks in a row.

Debrief:

  • Does one programmer drive the whole time? [No.]
  • Does the partner provide strategic guidance? [Yes; in this example, they hopefully read the tasks to the actor.]
  • Did the partner check that activities were done, and done right? [Perhaps even checking off the list.]
  • Did the "may I drive/would you drive?" questions feel awkward? [Probably – but you get used to it – and you can use a different phrase.]
  • Is the pair cost-justified? [Did the pair go more quickly and accurately together? Would they in general?]
  • Would you be faster on your own? [Remember the constraint of keeping the paper several feet from the actor.] What if your "bad" skills took ten times as long and your good skills were ten times faster than the average?

Task List:

  1. Stand on one foot for seven seconds.
  2. Put your arms straight over your head and count to three.
  3. Touch your head, then shoulders, knees, and toes.
  4. Spin once around to the left.
  5. Touch your eyes and ears and mouth and nose.
  6. Pat your head.
  7. Rub your stomatch.
  8. Spin once around to the right.
  9. Pat your head and rub your stomach at the same time.
  10. Touch your nose and say "chrysanthemum."
  11. Clap your hands twice.
  12. Open your eyes and give your partner a high five – you're done.

Source:
William C. Wake

Comments are closed.