You are currently viewing Coding Dojo for TDD

Coding Dojo for TDD

Write a failing automated test before changing any code

Kent Beck, Extreme Programming Explained 2nd Ed. 2004

Test Driven Development, TDD, is a process for writing code where you work iteratively in baby steps.
You make sure you are on the right path by frequently running automated tests.

This is how you stay focused:

  1. For any new functionality write a failing test first
  2. Write code until the test passes
  3. Refactor until the code is clean enough
  4. Goto 1

These are all rules. There is not more to it. These simple rules should not be broken.

What is a Coding Dojo?

Coding dojos train specific traits in a controlled environment: You select a well-defined task and solve it with the rules you are given.
Like for TDD the rules I mentioned above.

These tasks are called Kata, which is a term from japanese martial arts and means “Form”.

You can do a Kata alone or with one or more partners.

Do it in a group setting

In a real Dojo you are rarely doing things alone (depends a lot on the martial art though).
And in a Scrum team ideally also not.

So I think for developers the best setting is a mixture between Kumitachi and Randori format.

In martial arts Kumitachi are in general Kata you do with partners. So forms where roles of the actors are fixed. No room for interpretation here.

Randori is a playful match between contestants. It’s not about winning or losing but being able to apply the things you learned in a more free environment. Randori rounds usually have time limits (3 to 5 minutes are typical limits) after which partners are reassigned again.

In this combined format of these two training methods a Kata (Scenario) is selected and one developer takes the role of Tori (the giving side, the executing partner) and another one the role of Uke (the receiving side, the collaborator).
All others in the dojo are spectators.

Tori is the one controlling the keyboard. The only one allowed to code.
Uke may interfere and talk to Tori for support.

After 4 minutes Tori becomes part of the spectator crowd, Uke becomes the new Tori and one of the spectators the new Uke.

How to start a coding dojo

In case you are co-located with your team just sit together on a single machine and get started.
Otherwise in a full-remote setting open a meeting call and make Tori share the screen.

If you have a cool IDE like IntelliJ you can use the “Code with me” feature: You just share a link and allow other developers to use your IDE in parallel.
If you don’t have that I’d suggest to create a shared git repo with a branch that everyone can checkout and push to, so that between rounds people can just pull and continue.

So all that is missing now are ideas for scenarios. And for that I can help you.

Take a look at my github, where I provide a few small examples like the famous FizzBuzz!

Since at our company I just recently became a guild organizer of our “Clean Code Guild” I will try this with my colleagues too πŸ™‚


This Post Has 2 Comments

  1. Mohamed Ibrahim

    ιžεΈΈγ«θ‰―γ„θ¨˜δΊ‹ πŸ˜…

    1. Marc

      πŸ˜„ Thank you Mohamed.

Comments are closed.