Model-Based Testing Community | Connecting the MBT world…

Sep/13

26

Formalization by “Behavior Driven Development”?

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

http://en.wikipedia.org/wiki/Behavior-driven_development

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 http://jbehave.org/, 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.

 

Thanks

Bob Binder

 

 

No tags

6 comments

  • 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 (http://www.computer.org/csdl/proceedings/seaa/2009/3784/00/3784a121-abs.html).

    For the post http://model-based-testing.info/2013/07/01/domain-specific-mbt/ 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.

    Cheers
    David

    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.

    Reply

  • 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.

    Reply

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

    In the Scala world, there’s spec2 (http://etorreborre.github.io/specs2/) for behavior driven testing, which integrates very well with ScalaCheck (https://github.com/rickynils/scalacheck), which is an awesome framework for properties-based testing (imho, this counts as MBT).

    Reply

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

    Here’s an interesting comparison of JBheave and Cucumber

    http://mkolisnyk.blogspot.com/2013/03/jbehave-vs-cucumber-jvm-comparison.html

    Reply

  • 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 (http://www.ministryoftesting.com/training-events/testbash-2-0/).

    Reply

  • 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 http://www.robertvbinder.com/how-to-ice-the-testing-backblob/

    Reply

Leave a Reply

<<

>>

Theme Design by devolux.nh2.me
© by MBT Community 2011