Code Katas are so useful we wanted to analyze, share, and relive the infamous experience. Code katas are a core training practice for software development that I believe heavily in. To read more about what they are and a list of good ones to practice see my Dojo Code Katas post. Here I want to discuss a script I have been working on to relive the kata step by step.
How We Got Here
We have been doing monthly Randoris at work and we have been including committing to mercurial as part of our practice. Every refactor and every test/passing code pair we commit. This helps us practice committing often, a key rule to distributed version control, and writing better commit messages. This also allows us to relive the commits of each step/person as we rotate through the group. But there was no way to take those commits/diffs and output a useful report to quickly relive it.
What We Wanted
We wanted to be able to post the output back to our confluence wiki for a few reason. We wanted to be able to analyze where we went right and where we went wrong. We wanted others who couldn’t participate to be able to relive it as if they were there. We wanted different teams to be able to see how the same problem is solved by each other and note the subtle differences everyone has and some tricks that certain teams do vs others. Who knows of all the great possibilities, but an open source code kata repo wasn’t good enough. It had to be fast to view, easy to get to, and easy to analyze.
The Tool We Have Now
Thus started my journey to find the right tool. I failed to find what I was looking for. So I have dusted off some old old shell learning (it’s been years since I have created a shell script) and put together a mercurial code kata report shell script.
Here are some of the outputs at the time of writing this:
- Live BitBucket Source of Reports
- Copied Randori Reports from our Team
- Template Engine
cd codekatas ./codeKataReport.sh 2 11 BowlingGame.html
What Is Next
Next I am considering learning Python (I know who doesn’t know Python, I’m that guy right now) to attempt to write a Mercurial plugin to do all of this and see if I can’t get it part of the standard mercurial documentation. That would make it more useful and more robust.
I would also like to investigate a git version. I have barely played with git simply as mercurial has been great but I want to support Code Katas as much as possible.
Looking for help! I am sure this shell script could be reduced to half the size by someone who knows what they are doing. I am sure an experienced mercurial plugin developer or git developer could get started very quickly. If there was a good jumping off point it would be much easier for me to finalize the idea and update it with the more experience we gain and as needs increase.
Feel free to send me messages on Google+ with ideas, tips or whatever.
I wrote this to share the script, the ideas, the code, the kata examples and anything else you get from it. It’s all intended to be open and reusable.