Last week Rafael de Castro (@rafadc) and I facilitated a Coding Dojo for the Madrid Software Craftsmanship meetup group (219 members and growing every week!) in which we participate. The idea was to make a Dojo in which we could practice refactoring.
It went pretty well! This is the second time we meet in the MediaLab Prado in Madrid, a “citizen laboratory for the production, research and dissemination of cultural projects that explore collaborative forms of experimentation and learning that have emerged from digital networks.”, founded by the Madrid City Council, COOL!
For the Dojo we have chosen a well known Kata called “Gilded Rose”, it is a very simple piece of software that updates the quality value of the items in a store following some simple business rules. The problem is that the code sucks, we are asked to add a new feature but the code is so horrible that you don’t even know where to start.
We had limited time, so we choose JavaScript, that way nobody would have to install anything special on their computers, and everybody has a text editor and a browser to launch Jasmine, right?. We distributed several pen drives with the same copy of the code plus a working test runner. And because we wanted to focus on the refactoring techniques I also included the tests, already passing.
(at least the planned one!)
Protip: ask the people to bring their [WeirdAppleConnector] to VGA adapters if they have them! Also, for the final “show&tell”, it’s easier to collect the code in pen drives again than to connect many laptops to a projector.
The Kata code is on my github account, where you can also find a folder named ‘solutions’ that contains 8 of the solutions that were written during the Dojo. In most of the cases, 3 people participated in writing the code because pairs where swapped in the break.