The Test-Driven Development Duel

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. 🙂

  1. Alice writes a failing test, and hands the keyboard over to Bob.
  2. Bob tries to make the test pass with as little code as possible.
  3. Bob writes a new failing tests, and hands the keyboard to Alice.
  4. Alice tries make the test pass with as little code as possible.
  5. Restart from step 1.

Graphical representation of the TDD Duel rules.

  • Refactor now and then, as necessary.

This is also a very good way to teach test-driven development.

Leave a Reply

Your email address will not be published. Required fields are marked *