I had to ride a train with sketchy internet connection this week, which meant it was finally time to try Bob Martin’s Bowling Game Kata. This is a simple walkthrough of building a system for scoring bowling games using Test Driven Development. It is simple (one class, < 10 functions, often less than 200 lines of code), short (50 code examples, less than an hour to complete), and puts you into Bob’s brain as he points out bits of code he doesn’t like and refactors them.
I discovered the –watch argument for Mocha part way through the project, which saved some keystrokes and clicking by automatically running tests when relevant files changed.
I have only completed this Kata once. A Kata is supposed to be completed many times. It should be habit forming. I haven’t decided if this is a good to repeat over and over again. Is it too simple? I’m not sure if I would benefit from this one.
- CodeKata.com has many Katas.
- Peter Provost has a blog post to links with more Katas
- Searching YouTube for ‘bowling game kata’ brings up several screencasts of people going through the exercise in different programming languages