For automated acceptance testing we use the Fitnesse framework. Fitness is a Wiki page that enables testers to write executable tests as Wiki pages. Wiki pages are made up from text as comments and tables as tests. To integrate the tables with the application code, developers write Fixtures. Fixtures are a very thin layer of software that invoke application code and can be exposed on the wiki. The system is very easy to use.
There are a number of useful fixtures included in Fitnesse, but by far the most useful fixture comes from a separate library (FitLibrary): The DoFixture. A DoFixture exposes every public method as a row in a table. Every odd cell in the row is a part of the method name and every even cell is a parameter. This makes the table easy to read. The row
| train
| 123
| leaves
| Amsterdam
| station at
| 12:00
| to
| Utrecht Centraal
| station |
will thus invoke the method trainLeavesStationAtToStation(‘123’, ‘Amsterdam’, ’12:00’, ‘Utrecht Centraal’). As you see, the words in the odd cells are concatenated in camel case.
Unfortunately not all features of this fixture or the Fitnesse framework are well documented and easy to find. This blog will list a number of features that can improve the efficiency of using Fitnesse. The features shown are fixture loading, parse delegates and system under test. To enhance the usefulness of the last feature, we will also look at some improvements.
This blog is based upon the same version of fitnesse and fitlibrary as the "Fit for Developing Software" book.
(more...)