I gave a “brown bag” talk on Behaviour Driven Design (BDD) this week. I enjoyed the researching the content for the talk. Dan North’s couple of articles on BDD were really helpful: Introducing BDD and What’s in a Story?
It was interesting to see how BDD started as an evolution of Test Driven Development (TDD) but is now as much about stories, acceptance criteria and functional acceptance testing as it is about unit testing.
In preparing for the talk, I spent some time looking at the current state of BDD tools for .NET. There seem to be four main options:
- Cucumber running on Ruby, with the step definitions written in Ruby
- Cucumber running on IronRuby, with the step definitions written in Ruby
- Cuke4Nuke running on Ruby, with the step definitions written in C#
- SpecFlow running on .NET, with the step definitions written in C#
To help with understanding how Cuke4Nuke works, I’ve ported Cucumber’s calculator example over to C# and Cuke4Nuke. The code is available on GitHub: https://github.com/simondean/cuke4nuke-examples
In the discussion time after the talk, some interesting topics came up:
- Adopting BDD on a brownfield project
- Executing BDD features against a system “in-process” vs via a web browser or HTTP request
- Exposing a REST API to test the behaviour of a web-UI-based system instead of testing via the web UI
The slides from the talk are available here.