Latest on unit testing in Inform 7

Yes, I like that breakdown. In general, I found similar things. Essentially in the testing world you break things down into “edge-to-edge” tests and “end-to-end” tests.

  • The end-to-end would certainly be a path through the whole game. Not just “happy path” but the possible “unhappy paths.” Here I don’t mean “deaths” but any ending paths through the game where the story is brought to some form of conclusion. This is no different than basis path testing in the testing world.

  • End-to-end can also encompass all things that might occur in the context of, say, a given scene. In this context, you need to know all the things that can play out during that scene and thus the basis paths through the scene. This allows you to test the gating criteria for scenes to begin and end.

Then you get into lots of various edges, puzzles being one aspect of those – especially interconnected puzzles, where the solution to one puzzle requires solving another puzzle. Sometimes there can be multiple solutions, all of which have to work. Each puzzle thus serves as a type of edge and thus an interface. And that allows you to think about contract testing in the context of interactive fiction.

Another aspect, and a key component for my classes, was varying descriptions. For example, we used my own decaying descriptions ideas ([I7] Room Descriptions That Slowly "Decay") plus distantly viewable/visible extensions. And that meant we had a lot of text that was presented quite situationally. Authors wanted to make sure that text appeared as expected. So simple tests that would trigger the “description decay” and then assert on the text returned were crucial for them.

1 Like