Prime Factors Kata - First Try
This is my first try of the Prime Factors Kata. It's my first Katacast of a kata at all. I performed it with Groovy.
Stefan wrote about katas (in German) a while ago, where he described his experience as an attendee of the contest "TDD with the pros" ("TDD mit den Profis", TmdP) at the XP Days Germany 2009 in Karlsruhe. TmdP is similar to "Programming with the Stars" at Agile 2009 in Chicago, where I was an attendee of.
Stefan was in the final of TmdP with his pair partner Franziska Widmaier. Their task was to calculate all prime factors of a given number, which is the same task as in the Prime Factors Kata. Stefan and Franziska had to finish this task in less than 7 minutes - and they failed to do it in time.
Stefan and I started to work on that kata right after the XP Days ended. Our first shot was in the train from Karlsruhe back to our home town Hamburg. After that we met once via Skype and wrote each step we took during the kata. I practiced a few times per week for the last five weeks or so and showed my performance to Stefan today. He said that it'd might be time to show the result to the world, and here it is:
On Youtube:
I've also shared the Katacast on vimeo and on viddler.
My to-do list for the next try so far:
- Use a parameterized JUnit test instead of not isolated parameters in a map
- Use more of TextMate's shortcuts and optimize on a keystroke level
- Find out why 63 is too big... wtf? [Update: @datenreisender found out that this is related to a bug in Groovy.]
- [Update: @datenreisender suggested in the comments to use
primefactors
instead ofnumbers2primeFactors[number]
in the assertion.]
Happy Christmas!
P.S.: If you want to rate my performance, then post a comment with the number 0 (very bad) to 10 (very good). This kind of rating was inspired by Micah Martin. Any additional feedback is very welcome!