Saturday, 8 January 2011

TDD Kanban for Deliberate Practice

To help keep you in a good flow when you are learning or practising the TDD test first approach, it can be useful to use a simple kanban board to manage your flow.

The TDD kanban helps you to focus on each step, helping you to stick to test-code-refactor.

The TDD kanban board has three lanes as follows

Test - you are writing a single test
Code - you are writing code to pass a particular test that is failing
Refactor - you are changing the internal workings of your code

You only have one card on your kanban board (this is your work in progress limit), this reminds you which activity you should be working on and should help you get into the test-code-refactor routine.

The card itself is blank and does not refer to any required behaviour or example code.

Using the TDD Kanban board
To start, place your one and only card on the test lane of the kanban board.

Once you have written a failing test and run your tests, move the card on the kanban board to the code lane and write just enough code to make the test pass. 

Once you have written enough code to make the test pass (running all tests), move the card on the kanban board to the refactor lane.

When you have finished your refactor work and have run the tests, move the card back to the test lane and write another failing test.

Credits
The TDD Kanban concept is from the mini kanban display at Jon Jagger's cyberdojo (that's my hand) at the SkillsMatter Lean Agile exchange 2010.

5 comments:

  1. Nice. This works for a singular developer with no major dependencies. Simple, yet effective!

    ReplyDelete
  2. Hello AgileScout,
    Thanks for the feedback. I have updated the article to make it clearer that the TDD kanban board is useful for deliberate practice of TDD.

    The TDD kanban is particularly useful if doing a coding kata or coding dojo and can be used by solo or pairing developers.

    The example I give in the credits is from Jon Jaggers CyberDojo workshop, where it worked really well to keep people on track.

    Thank you.

    ReplyDelete