3.4. PHPSpec And BDD In Context

PHPSpec is the first Behaviour-Driven Development framework for PHP, so in PHP terms we're the new kid on the block - andfull of wacky ideas! Outside of PHP, BDD has become progressively more and more popular with a proliferation of frameworks from Ruby's RSpec to Java's JBehave. Frameworks exist for Java, Ruby, .NET, Smalltalk, Javascript and more. Often there exists more than one BDD framework in a language. Java has three or more.

On the flip side, traditional Unit Testing frameworks have started to take notice of the swell of support for BDD and started to provide BDD friendly APIs. These have not been overwhelmingly successful however. As I noted before - BDD is not just TDD with "should" instead of "assert". However these milder approaches are still valuable for intermixing BDD specifications with existing TDD Unit Tests without switching frameworks completely.

This will get more confusing as BDD frameworks start to do the exact same - offering API Runner support for Unit Tests so migration is even simpler. Something RSpec in Ruby is already beginning to improve in recent versions.