What are the differences between BDD frameworks for Java?

user68109 picture user68109 · Jul 1, 2009 · Viewed 46.4k times · Source

What are the pros and cons of each Behavior Driven Development (BDD) framework for Java?

I've found some of them here, for example.

Does it make sense to use a BDD framework if I already use a mocking library (e.g. Mockito)?

Answer

Caoilte picture Caoilte · May 2, 2011

I've just finished comparing three BDD frameworks for Java. Obviously my findings have a fairly short use-by date.

Concordion

  • Very flexible
  • Very pretty report output
  • Nice plugin framework
  • Poorly documented. I had to read the source to figure it out (luckily its extremely good quality).
  • Fixtures seemed likely to end up tightly coupled to the html.

EasyB

  • Very shallow learning curve (even for non-Groovy Developers)
  • Extremely powerful DBUnit integration
  • Apparently no support for parameters (leads to either very vague stories or duplication between text and code (edit: actually there is but the documentation for it was very well hidden.)
  • Story and Code are very tightly coupled (same file)
  • Very basic report output
  • Couldn't get IntelliJ plugin to work
  • Inactive community (Maven plugin seems to have been broken for three months - not many code examples to draw on)

JBehave

  • Extremely powerful and flexible (eg reduction of boiler-plate through composition of stories as pre-requisites)
  • Extensive (if fragmented) documentation and examples
  • Extensive (if overwhelming) support for different frameworks and environments
  • Excellent separation of story files from code
  • Looks to have a pretty active community and much more examples and discussion of it on web.
  • Quite a steep learning curve (took me 3-4 times longer to figure out than Concordion/EasyB)

I didn't have the chance to try out Cuke4Duke of JDave as I would have liked, but will probably push for JBehave at this time.