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:
- Stand on one foot for seven seconds.
- Put your arms straight over your head and count to three.
- Touch your head, then shoulders, knees, and toes.
- Spin once around to the left.
- Touch your eyes and ears and mouth and nose.
- Pat your head.
- Rub your stomatch.
- Spin once around to the right.
- Pat your head and rub your stomach at the same time.
- Touch your nose and say "chrysanthemum."
- Clap your hands twice.
- Open your eyes and give your partner a high five – you're done.
Source:
William C. Wake