Ping Pong Pair Programming
Blog post series
This blog post is part of a series about pair-programming games. To read about more please click see more sessions on pair-programming games.
- Learn pair-programming easier
- Force the “know-it-all” programmer to see other ways of writing code
- Force the “know-it-all” programmer to collaborate more
- Push for collective code ownership
The roles driver and navigator change often inside the pair.
This activity is like a game of ping-pong of the roles between the two members of the pair. They both can take short time decisions while being a driver and can spot strategic design decisions while being a navigator.
Refactoring can be made by any of the programmers on their turn, but only when the code and the tests are stable.
Variation with Timebox
You put a timer on the desk. Set it to let’s say 5 minutes (you can change the duration as you see fit) and start it. The driver and the navigator switch roles when the timer rings and both the code and tests are stable.
Variation for TDD
When doing TDD the driver writes exactly one test until the code can be compiled, but the test is red. The driver switches the role to the navigator. Now the driver, who was the navigator before, needs to make the test pass by writing the simplest code possible. After that the driver writes a new test until the code can compile, but the test is on red. Now the driver and the navigator switch roles again. In this way, considering that you have a simmilar average time to write all the tests, both the driver and the navigator have the chance to write tests and to write implementation code.
It is very easy to start doing it.
The facilitator, if any, needs to make sure the roles are changed in the pair.
The activity should be timeboxed and repeated.
When will you try this game?
Image credit: http://www.clker.com/cliparts/2/9/c/7/11949867871570711906table_tennis_omar_abo-na_01.svg.med.png