Yesterday I facilitated our monthly coding dojo again. Topic was 'Refactoring'. I chose the Gilded Rose Kata, which can be found in Emily Baches Github repository. In my opinion it went quite, but I also learned some things; which of course is a good thing.

First is to not introduce to many new things; my coding dojo group is quite new to this topics. Some developers are young and unexperienced, like I am unexperienced in facilitating katas. As suggested in the kata we used texttest, a tool to compare the output of a testrun against a golden master text output. I installed this tool a month ago myself and tried it only once myself. While this worked like a charm for me, it did not work so easy for some of my coworkers. We spent over thirty minutes to setup everyones environment to get everybody start coding. Also I was not prepared good enough to give installation and setup instructions.

Next lesson for me was to make clear that "Refactoring is not Reimplementation". Some choose the approach to delete the whole code and reimplement it. That is clearly not the goal of the Kata. Out of 4 implementations two were completely ditching the code and implementing the provided requirements. Last night I thought about how to prevent this. One solution would be to not provide the detailed requirements, so that that you have to rely on the given implementation. Instead of the requirements only a rough description of the system would be given.

BUT this would make one of the approaches, writing own tests, extremely difficult. When I did the kata the first time myself I did not use the provided testtest but implemented some acceptance tests myself to get a reasonable coverage of the provided requirements.

Only one of the teams started to implement own tests. And they got lost in implementing very detailed and complicated tests, so they ran out of time without even starting to refactor the code.

I ended the session with an retrospective and closing circle where we had very interesting discussions about the difficulties provided by the code. And of course had a discussion about when to refactor and when to start reimplementing.