A TDD Kata is an exercise in writing code, test first, which one repeats once or more a day. Here's an example of one.
I make students that take my TDD course do this kata each morning, in the space of 30 minutes.
Near the end of the course, they become more and more skilled with the tools and can actually get to finish it in 30 minutes, and they get faster and faster.
The point about the Kata is that you should know it by heart. you should not be thinking about the solution, your fingers should by typing it "blind", including all the refactoring work, the renaming and whatever else you do.
A Kata is about muscle memory - so that we feel comfortable doing that something in the real work, without needing to think about it.
If you know it well enough, you can start timing how long it takes you to finish it. THe faster you finish it (with same results, clean code and working implementation) the more it means you are productive.
Why?
Because at some point, the only things that take the time in the kata are those darn keyboard keys and mouse! The more shortcuts, snippets and key combinations you learn to get your job done, the more you have minimized those things in your developement writing that take the time.
So a kata is about muscle memory, but you can use it to measure how well you are mastering your tools, or how productive you are as a programmer.
what's fascinating, is that if you look hard enough you'll find that there's always something that can be done even faster eithout hurting the end consequances. here are some examples:
- No need to type that whole Setup method with attributes on the code. Create and use a live code snippet to generate it in a click or a key press.
- No need to select a whole line before removing it - learn to use shortcut keys to do that in one action.
- No need to manually go to a code finle when you can navigate to the last edit location in a blink of an eye with your tools
and there are a million more.
it's about mastering your craft. and now there's a way to measure it.