Earlier this week I told you about some of our experiences with our 1 hour a week TDD sessions. I would like to share a great tool that came out of one of those sessions.

In one session, I explained the 4 contact points of software development and that you should only change one at a time.

The 4 contact points are:

  • Writing test code
  • Writing production code
  • Refactoring test code
  • Refactoring production code

Focusing on only doing one of these things at time, can keep you out of trouble and more importantly give context to the conversations with your pair programmer. When pairing the navigator can now notice that the driver is refactoring the code instead of making the test pass or refactoring both production code and test code with out running all the tests in between. For me this is the one set of rules that really helps keep you engaged when you are the navigator in the pair.

For some of the participants in the session this was new information and really got people thinking. One pair, Nick and Shan, embodied these rules in paper selector that they used to communicate which particular point they were doing at a time. You can see the “selector” token they created.

TDD step selector

Before they would switch from writing a test to writing production code they would turn their selector to “Write Code” then begin writing the code to make the test pass. Once the test pasted they would decide if they would refactor or write another test and turn the selector to the appropriate side.

The pair always knew what type of work they where attempting to do – they could just look at the selector in front of them. They also found that it really helped them focus on doing only one type of work at a time and reminded them to look at all the options of what they could do once they finished a step.

I thought this was a great tool and worth sharing. Try making your own and see how it feels to focus on one type of work at a time.