Wednesday, October 3, 2012

Cucumber, and BDD: Behavior-Driven Development

So here's something I ran across (again) today, and really started thinking about what it means: behavior-driven development, BDD.  It's a philosophical refinement of test-driven development, in which you define test scenarios in, essentially, English using some keywords (Feature:, Scenario:, etc.).  This keyworded set of requirements is then used to define tests, and then you do the TDD thing to make all the tests work.

It's pretty cool.  It's been an outgrowth of the Ruby Agile community, and its latest incarnation there is Cucumber.  And yes, there is a Test::BDD::Cucumber on CPAN.

So here we have a very declarative approach to specifying the behavior of a program and using that to drive the development process.  I don't care for the somewhat clunky regexp-driven way you get from the plain text description to the executable code, but the overall shape of the development process is very promising.

Here's the Wiki page for BDD.  It points out that some of the notions in BDD come from domain-driven design.  And all of that needs to be condensed a little into some principles for Decl, perhaps.

No comments:

Post a Comment