Model-Based Testing Community | Connecting the MBT world…



Formalization by “Behavior Driven Development”?

The Behavior Driven Development approach provides a template for “specification” using certain keywords.

Specification: Stack

When a new stack is created
Then it is empty

When an element is added to the stack
Then that element is at the top of the stack

When a stack has N elements
And element E is on top of the stack
Then a pop operation returns E
And the new size of the stack is N-1

Using a documentation tool like JBehave, these statements are manually converted to code, which uses @ tags to match code expressions to keyword expressions.

If anyone has tried or knows of using BDD as an interface to model-based test generation, please post here.



Bob Binder



No tags


  • Author comment by David Farago · September 26, 2013 at 9:09 pm

    Thanks for your blogpost, Bob.

    With a rise in both MBT and BDD, I think this is a very relevant question.

    I came in contact with the combination only in the widest sense: Contracts are close to BDD (PRE/POST instead of WHEN/THEN) and can be considered to describe the transitions in a behavioral automata. One example are visual contracts, which Baris Güldali and Michael Mlynarski have been using (

    For the post I searched for direct applications of BDD(-tools) for MBT and did not find anything. But maybe the two comments giving references to Juha-Pekka Tolvanen’s and Holger Funke’s contributions to Domain-Specific MBT will help? I do not know how close their DSL is to BDD.


    P.S.: I modified the title of your blog post slightly. If you do not like it, please change it back or let me know.


  • Andres Kull · September 26, 2013 at 9:25 pm

    Elvior TestCast MBT is generating tests for keyword driven Robot Framework. This is almost the same as BDD.


  • Joachim Hofer · September 27, 2013 at 5:00 am

    In the Scala world, there’s spec2 ( for behavior driven testing, which integrates very well with ScalaCheck (, which is an awesome framework for properties-based testing (imho, this counts as MBT).


  • Bob Binder · October 1, 2013 at 1:07 pm

    Here’s an interesting comparison of JBheave and Cucumber


  • Author comment by David Farago · October 3, 2013 at 8:45 am

    Great references, thanks everyone.

    If you are interested in a comparison between BDD and semi-automation when oracles become too hard to automate: take a look at Matt Archer’s presentation on TestBash 2013 on balancing test automation techniques (


  • Author comment by rbinder · December 7, 2013 at 4:48 pm

    In the several months since posting my question, I’ve looked at ATDD, BDD, and related tooling both in theory and in application to large systems. I’ve concluded that a collection of “given-when-then” narratives and their handcrafted test cases are better than nothing, but not by much.

    My thoughts on this are given in a recent presentation and related blog post – for an overview and links, please to go


Leave a Reply



Theme Design by
© by MBT Community 2011