Dave Astels’ BDD paper

If you’ve ever been wondering what the difference is between Test Driven Development and Behaviour Driven Design, Dave Astels has written a fantastic paper which explains it all, linked here.

It mentions JBehave, which is still in version 0.0.1 … we’re going to have to do something about that. Soon. I promise.

These are the things I’m learning to love about JBehave while messing around with it:

  • JBehave’s MockObject.proxy() is deprecated. You can now cast the mock directly. (With a minor bug to be fixed soon.)
  • The aggregate context, event and outcome classes have been renamed to Contexts, Events and Outcomes, respectively. Each one can take two or more Context, Event or Outcome objects. This makes them immeasurably easier to use.
  • The whole Context, Event and Outcome framework leads to a more OO framework for story and scenario specifications (no more procedural functional tests!).
  • Verify.that(…) is far easier to use than assertEquals(…), and you don’t have to extend anything to use it.
  • JBehave’s like that. You can take the mocks, or the behaviour framework, or the story runner, and use them all completely independently of each other. If you have a ‘test’ framework, or a mocking system, or a gui harness, which you prefer to JBehave’s, you can just plug in whichever bits of the JBehave APIs you need to fill in the gaps.

That’s quite aside from the shift in thinking that BDD encourages, which is bigger by far than our little framework.

This entry was posted in Uncategorized. Bookmark the permalink.

6 Responses to Dave Astels’ BDD paper

  1. anonymous says:

    Good to see someone writing about BDD. I just hope that Dan hasn’t missed an opportunity.

  2. sirenian says:

    Ach, he’ll get his fifteen minutes and then some. 🙂

  3. anonymous says:

    um… it’s “Astels” but anyway

    Verify.that(…) is one of the issues I have with jBehave… it’s still verification-speak

    in ruby we’ve been able to simply do “actual.should_equal(expected)” and such.

    I realize that in Java (limited, inferior language that it is) you can’t generally do things the way they should be done.. but what about a syntax something like:



    I don;t have trouble with inheriting from Context or whatever, it’s a framework and these are single minded classes.


  4. sirenian says:

    Apologies, Dave; I shall immediately make steps to get my apostrophe under control.

    I like the idea of an expectThat syntax. I guess Java does flavour our framework here, because we have both ‘==’ and the ‘.equals()’ equality, and because we frequently need more complex constraints than just .equals(), eg: instanceof, contains, etc.

    I’d be interested in any ideas you might have for better syntax that could encompass such constraints.

    Maybe an expectThat(constraint).is(true)?

  5. anonymous says:

    Hi Elizabeth,

    I was wondering if someone can maybe do an article on the architecture or the way of thinking when working with JBehave or maybe an introduction tutorial on how to use JBehave as a tool. At the same time enlightening the reader to the whole BDD mind shift. I’m not a native Java developer… So any help would be appreciated to help me understand the JBehave framework.

    I’ve followed the discussion of BDD on the XP list with great interest. I’ve also started to use BDD type test names for my TDD test and have found it greatly helps with the communication of the test method intention.


    Maruis Marais
    Software Developer
    Orbiz International

  6. sirenian says:

    Marius, the articles are coming out – Dan’s writing one at the moment; I’ll certainly be linking it on my blog when it’s finished.

    I will also be making my Hellbound code, which is BDD-driven, available for anonymous download as an example. I’ll do this once the first story is finished, which I expect to be about a week, maybe two.

    May I please quote you as saying “I’ve started to use BDD type test names for my TDD test and have found it greatly helps with the communication of the test method intention.”?

    I’d like to pass it on to Dan, too. Attributed or anonymous as you wish. We need testaments like this (positive or negative).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s