Driver/Navigator Switch Techniques
Pair programming encourages participants to switch roles often. These procedures make sure everyone has a chance to drive and navigate. It is crucial that both partners spend an equal amount of time performing each role. There are a few techniques you can use to encourage this.
Chess Clock
Using a chess clock, the pair assigns a time period for performing each role. When the clock rings or a natural breaking point occurs, the pair switches roles.
Ping Pong/Popcorn
- A Driver (B Navigator): Writes a new test and sees that it fails for the right reason.
- B Driver (A Navigator): Implements the code needed to pass the test.
- B Driver (A Navigator): Writes the next test and sees that it fails for the right reason.
- A Driver (B Navigator): Implements the code needed to pass the test.
- A Driver (B Navigator): Writes the next test and sees that it fails for the right reason.
- Rinse and repeat.
Caution
If you do not use ping pong...