Fit for Developing Software: Framework for Integrated Tests

11.3. Two-Dimensional Images

Rather than relying on text in Fit tables, it may be better to use images. When the test data is naturally graphical and in a two-dimensional grid format, images can be more direct in expressing the tests that are needed. ImageFixture tables allow this.

For example, Figure 11.3 shows part of the tests for a Sokoban[1] program: a table with images in the cells instead of text. This format has been used to test that the current board state of the Sokoban program is correct after several moves have been made.

[1] Sokoban is a strategy game; the player moves a character around the grid in order to push all the boxes in the room into shelves in a goal area.

Figure 11.3. A Table of Images

Programmers

The fixture code for the tests here is given in Section 29.3 on p. 251.

    Категории