Definition
In the cited HOL-TestGen test-program-generation workflow, the term test oracle is used for an instantiated test case: the test execution phase "converts the instantiated test cases ("test oracles") to test driver code" that is run against the system under test (SUT). This usage ties the oracle to executable testing infrastructure rather than describing it only as an abstract expected-result predicate.
Role in the generation workflow
The evidence describes a three-phase process around test cases:
- A generation phase partitions the input/output relation using a CNF-like normal form.
- A test-data selection phase constructs an instance for each partition using constraint solvers, random test generation, and the SMT solver Z3.
- A test execution phase converts the instantiated test cases—identified as test oracles—into test driver code and runs that code against the SUT.
Sequence-test context
For sequence-oriented testing, the evidence distinguishes unit-test generation from sequence-test generation. Unit-test-oriented methods use preconditions and postconditions of operation specifications, while sequence-test-oriented approaches use temporal or automata-based specifications of system behavior. In test program generation for a processor, the processor state is an important part of the test description, and tests describe sequences of state transitions performed while executing program instructions.
Formal view used in HOL-TestGen
Because HOL is a purely functional specification formalism without built-in state and transition concepts, HOL-TestGen represents sequence test specifications using monads. The cited work uses a state-exception monad to model partial state-transition functions. In this model, programs under test can be viewed as input/output stepping functions: for a given state and input, a step may fail, or it may produce an output and a successor state.
A valid test sequence is characterized in the evidence as one with no exception in which a postcondition P evaluates to true for the observed output. For repeated execution, an mbind operator takes a list of inputs, feeds them sequentially into the SUT, and stops when an error occurs. HOL-TestGen represents sequence test specifications in this style, and when a postcondition depends explicitly on the underlying state, the evidence uses the assertSE primitive instead of return(P).