The Robot Factory Kata
On the drive home from my last Behavior Driven Development talk, I began thinking about the idea of Code Katas and how one might be appropriate in my future disucssions of Behavior Driven Development. Given that BDD tries to solve things in as simple and direct a path as possible, and given that BDD takes some of the lessons learned via TDD and applies them in slightly more business-centric language, a Kata would demonstrate well the effectiveness of BDD when applied to a problem domain.
So, I took the example problem domain of a robotic assembly line that I've been using since I was training full-time under the guidance of J. Michael Palermo IV and implemented it using SpecFlow and Moq. So far, the Robot Factory Kata video series has two videos.
The first of these demonstrates the project setup and configuration, and starts solving the problem using SpecFlow specifications and NUnit tests.
The second part helps demonstrate how mocking method verification using callback expectations to demonstrate testing interaction between two objects. Sure, this is getting into integration testing, but the idea is to demonstrate BDD using a legitimate problem domain that's slightly more interesting than the construction of a calculator. Not that there's anything wrong with that, but you know, it helps to have variety.
Hope you enjoy these video demonstrations and that they motivate you to start BDD'ing today.