| Chapter 2: The Source Text |

| 2.8. The TEST command

The only way to thoroughly test a work of IF is to run a complete solution through it, and carefully check the resulting transcript of dialogue. The Skein and Transcript tools of the Inform application are provided for exactly this purpose.

All the same, most works of interactive fiction contain occasional vignettes, either in terms of short scenes of narrative, or in the behaviour of particular things or rooms, which we would like to test without the fuss of using the full game-level Skein tool. The examples in the documentation are like this: in almost every example, typing TEST ME puts the game through its paces.

| Solutions or sequences for testing ("scripts") can be defined with sentences like so: Test balloon with "get balloon / blow balloon / drop balloon". This has no effect on the design itself, but ensures that when the game is played, typing "test balloon" will run through the given three commands in sequence, as if we had typed "get balloon" and then "blow balloon" and then "drop balloon". The name for the test (balloon in this example) has to be a single word. Typing just "test" at the game prompt gives a list of all the test scripts known to the game. Test scripts can make use of each other, for instance: Test all with "test balloon / test door". One convenient way to keep track of the solution for a work being written is to include a test script at the end of each section, and to place a master test script (like "test all") at the top of the source. But different designers will prefer different approaches, and this testing system is no more than an optional convenience. Many tests will only be sensible in given places, which may be hard to reach from the initial position; or with the aid of given things, which may be difficult to obtain. We are therefore allowed to add stipulations to test scripts: Test balloon with "get balloon / blow balloon / drop balloon" holding the balloon. The "... holding the balloon" means that the balloon will be transferred to the player's ownership immediately before the test script is run, unless it is already held. Similarly: Test jam with "get jam / taste jam / eat jam" in the Kitchen. Or we might want to say both: Test jam with "get jam / taste jam / eat jam" in the Kitchen holding the jam.

Previous | Contents | Next