next up previous
Next: Test program generation Up: PGMGEN tool Previous: PGMGEN tool

Test script language

A test case is described by providing a trace on a module and associating it with some aspect of the required behavior of the module in response to that trace. We represent a test case as a five-tuple

with the following interpretation.

trace:
a trace used to exercise the module.

expexc:
the name of the exception that trace is expected to generate (or noexc if no exception is expected).

actval:
an expression (typically a get call) to be evaluated after trace and whose value is taken to be the ``actual value'' of the trace.

expval:
the value that actval is expected to have.

type:
the data type of actval and expval.

In test cases developed solely to do exception checking, the actval, expval, and type fields contain dc, for ``don't care.'' Below are two test cases for symtbl.

    <s_init().s_add("cat",5), noexc, g_exsym("cat"), 1, boolean>
    <s_init().s_add("cat",5).g_loc("dog"), notexsym, dc, dc, dc>
The first trace initializes the module and adds the symbol "cat" with location 5 to the table; it then checks that g_exsym("cat") returns the correct value. The second trace also adds the symbol "cat" and then calls g_loc("dog"), which should signal the exception notexsym.



Peter Walsh
Thu Jan 18 13:59:59 PST 1996