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.