Write a failing automated test before changing any codeKent 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:
- For any new functionality write a failing test first
- Write code until the test passes
- Refactor until the code is clean enough
- 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.
Since at our company I just recently became a guild organizer of our “Clean Code Guild” I will try this with my colleagues too 🙂