Clean Code Clinic: TDD Ping Pong Match!

room: Osgoode Foyer, LC — time: Tuesday 10:45-12:15
Average Rating: -

In this clinic session, attendees will pair-program on implementing small software application features following the TDD Ping Pong game rules. Each game will last for a few minutes, and the programmer with the least time driving (i.e. doing the simplest thing that works and coming up with the most tests) will be declared winner. This game is a great opportunity to sharpen your TDD, refactoring, and pair programming skills Winners will receive prizes, so get ready for Andy and Dave’s challenge!

Process/Mechanics

The TDD Ping Pong game is played with developers who practice pair-programming and test-driven development while building software application features. The game works as follows:

  • First developer writes a unit-test
  • Second developer writes just enough implementation code to pass the test. The developer is timed while doing so.
  • Once the test passes, Second developer writes a new unit-test
  • First developer writes just enough implementation code to pass the test. The developer is timed while doing so.

At the end of developing the required feature, implementation times are compared between both developers and the one with the least time wins. Therefore, to win, one has to write no more than enough code to pass the test, and one has to come up with as many tests as possible to make the other developer write more implementation.

Here are the details of how the competition will be run:

  • There will be two machines, allowing us to host two TDD Ping Pong matches at a time
  • Each match will be played by two of the attendees as they pair-program on the same machine
  • Each match will be monitored by one of the presenters
  • One of the game machines will be connected to the projector to let other attendees watch the games (and cheer if need be)
  • A single match will take 5-10 minutes, resulting in about 16-32 game matches overall (involving 32-64 attendees.)

Andy and Dave will actively comment during the games to coach people on pair-programming and test-driven development best practices.