-
Get a monthly update on best practices for delivering successful software.

At today's Web 2.0 Expo, Greg Pollack of Rails Envy introduced me and a few hundred of my latest acquaintances to Behavior-Driven Development. Basically a mash-up of Test-Driven Development and Domain-Specific Langauges, BDD empowers developers to turn English-language spec documents into working test suites with a minimum of fuss.
Pollack's talk was titled The Art of Testing Web Applications, but his copious code examples skewed, unsurprisingly, toward Rails. Easily mixing high-level concepts with nitty-gritty code, Pollack showed how to turn existing Rails unit and integration tests into BDD tests using the RSpec framework. Although the translation from one testing framework to the other seemed almost 1:1, the difference in readability was striking. I can actually see clients and product managers/business owners using these test suites in the real world.
Given all the hype about DSLs at last fall's No Fluff Just Stuff conference, it was cool to see a real-world application of those ideas. And given Pathfinder's synthesis of User Experience Design and Agile development, it seems like RSpec is an excellent tool for us. By breaking tests down into user stories and allowing plain-English spec documents to be parsed and run, RSpec puts TDD into a common language for us and our clients.
In fact, my colleague Noel Rappin has posted about his experiences with RSpec on this very forum. Funny that I had to travel all the way to San Francisco to pay attention!
Related posts:
Topics: Ruby on Rails, Test Driven Development