Anagram Code Kata – BDD & MSpec
Many forms of martial arts utilize the kata as a means for detailed, focused practice and training. The power of this practice comes from repetition and focus on simple fundamentals, “while attempting to maintain perfect form.” The principle goal is to “try out different combinations of techniques in a safe, practice environment to ultimately find out how to defeat your opponent”. In the last few years, this concept has taken hold within the software development world in the form of Code Kata, a phrase coined by Pragmatic Programmer Dave Thomas (and here is his blog dedicated to the Code Kata).
My inspiration for all of this is David Tchepak’s Calculator Kata series of posts. Hopefully he will stop by and provide some helpful guidance and advice. I have selected the Anagram Kata (code kata number 6) for me to practice. My goals for this series of posts are:
- To practice coding and share my learning experience with you, while also soliciting feedback and suggestions.
- To more fully understand the concepts driving Behavior Driven Development (BDD) via a testing framework designed for such a practice, namely MSpec.
- To keep to the SOLID principles of Object-Oriented Design, especially in favor of test driving logic over just testing data.
Below I will keep an updated list of blog posts in this series. Hope you enjoy it!
- Part 1 – Getting Started
- Part 2 – Mocking and SRP (Single Responsibility Principle)
- Part 3 – Use Common Sense
- Part 4 – Will it Write My Code for Me?
- Part 5 – Domain Objects Over Language Primitives
UPDATE (07/18/10): I was asked where the source code to this post series could be found. I decided to host it at BitBucket.org using Mercurial for the source control: http://bitbucket.org/murrayondotnet/anagramkata/