jbehaveI spent a really interesting hour the other day with a colleague of mine, Steve Cresswell, going through his recent work to integrate natural language capabilities into a popular open source web test tool.

He’s been integrating JBehave with Selenium.

JBehave is a framework for Behaviour-Driven Development, and takes test-driven development (TDD) for agile to the next logical level, where instead of your business reps looking at your JUnit test with you (and hoping that the comments that explain them are up to date and consistent with the code!), you create and then execute your tests in the ultimate natural format – in English.

A simple test scenario might look like this…

Given I am logged in
When I enter an order for 10 books at a price of £2.10
Then I should see an order confirmation

Selenium is widely known in the agile community – the killer features of the Selenium IDE are that there’s very little barrier to entry for QA’s and Product Owners (customers) and unlike some of the alternatives it runs in the real browser rather than a partially simulated environment. What Steve has done is to put Selenium and JBehave together in a way that the authors hadn’t expected (i.e. having Selenium “drive” JBehave, rather than JBehave drive selenium) using AJAX + JSON to make the process more seamless…and then created a simple web app which dynamically discovers the JBehave’s “given” steps and lets you invoke them.

It’s a fascinating area and one I’d like to spend more time getting into – but heh, you can’t cover it all. But I love the idea of sitting down with your customer and creating definitions of success in English language, then building the app and those tests become your regression test suite – it takes away another barrier between the developer and customer worlds which can only mean better, quicker deliveries.