Sunday, 2 November 2008

RestFixture latest additions: JSON support and Sequence Diagrams Generation

RestFixture has been enhanced with two new features:

  • basic support for JSON;

  • runtime generation of sequence diagrams showing the flow of http calls within a table

First of all, thanks to AndyO as he is the author of the JSON support enhancements. Now RestFixture allows testers to write and verify expectations for content returned in JSON.

As for the second feature, the generation of sequence diagrams from a RestFixture table, the idea has been growing since i found UMLGraph, a nice tool that generates class and sequence diagrams. The idea is that for describing complex REST API interactions... a picture is worth a thousand words.

Here follows two simple diagrams and associated tables to demonstrate the generation of the diagrams.
Note that the diagrams are generated at execution time, therefore they reflect the actual outcome of the run of a RestFixture test. This means that if the test fails the picture shows the flow of messages that failed the test.

The diagrams are pretty basic and they only show the objects (or resources) involved, the verb, the return code and, for POST the id, taken from the Location header.

Full instructions on how to install the required software and how to use the new feature are available in the RestFixture web site.

Support for generation of the diagrams is basic. It has been extracted out of the main RestFixture trunk as it's still in spike mode. The code, though is checked in the same SVN trunk (the project is called PicBuilder).

As always comments are very welcome!!