What I call the Test-Driven Development Duel (or test duel for short) is a simple and fun way to use test-driven development and pair programming together. It is all about challenging each other to implement tests with as little code as possible. The rules are rather simple, but surprisingly productive. It can be especially fun if you are somewhat competitive as a person. 🙂
- Alice writes a failing test, and hands the keyboard over to Bob.
- Bob tries to make the test pass with as little code as possible.
- Bob writes a new failing tests, and hands the keyboard to Alice.
- Alice tries make the test pass with as little code as possible.
- Restart from step 1.
- Refactor now and then, as necessary.
This is also a very good way to teach test-driven development.