Behaviour-driven development (BDD) frameworks

Behaviour-driven development (BDD) is an agile development technique, and is a subtle reworking of test-driven development (TDD). Learning about it finally made the concept of TDD "click" for me. People often use the term "test-infected" or "bitten by the testing bug" to describe the feeling that comes from appreciating the power of BDD/TDD, and I'd certainly say that I'm a "sufferer".

The purpose of this post is to compile a list of BDD and TDD frameworks that I've come across, covering several different programming languages. I hope to write up some simple examples of using a few of the frameworks at a later date.

I've heard it said that if you're doing TDD right, then you're already practising BDD, and this made a lot of sense once I understood the reasoning behind BDD. I'll leave further explanation of the differences to the experts.

Without further ado, here's the list:

PHP

  • PHPSpec, a fledgling BDD framework for PHP5.2+. The manual is well-organised, and gives a good overview of writing BDD specifications. Its development seems to have stalled at present, unfortunately.
  • Marcus Baker's SimpleTest (TDD). This is the framework for PHP that I have most experience with, and it seems to be the most popular at present. It has a plethora of features, including strong support for mock objects. The manual gives a good overview of the major features.
  • PHPUnit (TDD). I have no experience with this one, but it's one of the most established PHP testing frameworks, and it still seems to be popular. Like SimpleTest, it has plenty of features, and the manual appears to be very thorough.

JavaScript

C

  • Cgreen (TDD), which is by the same author as SimpleTest. It has a five-minute example of test-driven development with the framework. It was heavily influenced by...
  • The Check framework (TDD), which has a fairly friendly manual. I know even less about this one than Cgreen, sadly.

Both of these projects seem to have been dormant since 2006. The Check manual lists a number of similar projects, but I've not even glanced at those, as I'm still a C newbie.

Python

  • PySpec is the only BDD Python framework I could find, and while it appears to have a good amount of features, development is slow. It has a decent one-page usage guide, a reasonable tutorial, and a code reference with examples.
  • Doctests. I absolutely love these little things. The Python manual section on them is pretty comprehensive. They have a very low barrier to entry, and virtually no learning curve. The advanced features of independent testing frameworks aren't present, however.
  • nose (TDD), as I understand it, wraps Python's included unittest module to provide an interface similar to py.test, which I have no experience with. nose has a mini-manual on its homepage, and a wiki on its Google Code project site.

Ruby

  • RSpec. I don't really do Ruby (yet), but judging by what I've seen of RSpec, I seriously doubt whether anything else is even worth considering. The Rubyists really seem to get BDD.

1 Responses to Behaviour-driven development (BDD) frameworks

  1. 4657 Kilian Valkhof 2008-11-23 20:32:46

    Great list Paul, thanks! I'm gonna play around with the JSSpec in the near future now that I know of it. :)



About

I'm a web developer with a passion for standards, and a strong belief in quality-over-quantity and using the right tool for the job.

User