Sunday, April 18, 2010

Concordion

Concordion is a simple testing framework to allow for "executable specification", similar to Fit[nesse].
html files with minimal markup are bound to code via a simple adapter class, and run via a JUnit testcase base class.

First write some simple HTML to describe the requirement, eg:

Then apply some trivial markup to identify the 'interesting' bits: We then create a Java class that extends ConcordionTestCase to act as an adapter for the HTML. In this example the class would have method called 'topup' which accepts three parameters (phoneBalance, bankBalance, and topup), and returns a structure containing 'phoneBalance' and 'bankBalance'. eg: When the unit test is executed Concordion generates HTML showing the result of the call, with something pretty, like:
When user Bob has $5 phone credit, and $10 in their bank account, a $8 topup will result in $13 credit on their phone, and $2 in their bank account. Txt message result will be 'Topup successful'

I also took a look at JBehave, which seemed to require much more scaffolding code, for no obvious benefit. It also wasn't as pretty as Concordion :-)

Robot Framework and TextTest look like they might be useful for traditional testing staff.

PS: Mark's idea is worth thinking about.

No comments:

Post a Comment