Alex headshot

AlBlue’s Blog

Macs, Modularity and More

FitLibrary storytests

2006, test

Rick Mugridge of RimuResearch.com has just given a presentation on writing storytests with FitLibrary, an extension of Fit that can run storytests within FitNesse (or on its own via FolderRunner). The goal is to be able to support storytests -- that is, a set of tests which encapsulate a story (in the XP/Agile sense).

Like Fit, it supports the ability for tests to be encoded as HTML files that can then be run as a test case against running code. Unlike a simple table which tests individual methods (and expected results), FitLibrary has nested tables to allow both objects and actions to be created. The DoFixture test allows a squence of things to be run. From that test page:

ChatStart

connect usersarah

usersarahcreatesfitroom
usersarahentersfitroom

users in roomfit
name
sarah

The goal is to encode the story test in a business domain so that business analysts can understand the point of the test, rather than having to work at the code level. A binding mechanism translates the steps into underlying code (for example, to map the business terms into the names of classes under test); although this binding can be changed easily, if you change the name of the domain language (which happens) there's currently no refactoring that can be used to change the individual tests.

The benefit of encoding the tests for the stories in this form is that it allows a set of specifications to be made prior to any code being written, but not to the extent that all stories must have test cases for them. In an interactive example, the story tests for that iteration need to come before the code; but you can stack the iterations such that during one iteration, the story tests for the next iteration are being coded. The video is now available.