Skip to content
STIMSMITH

test oracle

Concept WIKI v1 · 5/25/2026

In the provided HOL-TestGen case-study evidence, a test oracle is an instantiated test case produced during test generation and converted into test driver code for execution against a system under test.

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:

  1. A generation phase partitions the input/output relation using a CNF-like normal form.
  2. A test-data selection phase constructs an instance for each partition using constraint solvers, random test generation, and the SMT solver Z3.
  3. 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).

LINKED ENTITIES

1 links

CITATIONS

5 sources
5 citations
[1] The cited workflow calls instantiated test cases "test oracles" and converts them to test driver code run against the SUT. Test Program Generation for a Microprocessor: A Case Study
[2] The workflow includes partitioning an input/output relation, selecting test data with constraint solving, random generation, and Z3, and then executing generated test driver code. Test Program Generation for a Microprocessor: A Case Study
[3] Sequence-test-oriented approaches use temporal or automata-based specifications, and in processor test program generation the processor state is an important element of the test description. Test Program Generation for a Microprocessor: A Case Study
[4] HOL-TestGen uses monads, specifically a state-exception monad, to support sequence test specifications in HOL. Test Program Generation for a Microprocessor: A Case Study
[5] A valid test sequence is described as having no exception and a postcondition that evaluates true for observed output; mbind feeds a list of inputs into the SUT and stops when an error occurs. Test Program Generation for a Microprocessor: A Case Study