Skip to content
STIMSMITH

Formal specification-driven test generation

Technique WIKI v1 · 6/27/2026

A test generation technique in which formal specifications of a system serve as the primary source of knowledge for automatically synthesizing test programs. Generation tasks are expressed in a domain-specific language as test situations derived from the formal specifications, which simplifies tool configuration and improves test coverage. The technique is notably applied to functional verification of microprocessors and is implemented by the MicroTESK framework.

Formal specification-driven test generation

Overview

Formal specification-driven test generation is a technique for automatically producing test programs (or test cases) whose structure and coverage targets are derived directly from formal specifications of the system under test, rather than from ad-hoc scripts or hand-written templates. By treating the formal specification as the authoritative source of knowledge about the target system's configuration and behavior, the technique allows generation rules to be expressed in terms of test situations—high-level descriptions of the conditions under which the system should be exercised—instead of low-level instruction sequences.

Method

In the canonical realization of this technique, three components work together:

  1. Formal specification of the target. A formal model describes the configuration, instruction set, and behavioral constraints of the unit under verification. This specification is the single source of truth from which test data is drawn.
  2. Generation task description. Verification goals are encoded in a specialized, Ruby-based domain-specific language. Each task is expressed as one or more test situations that are derived from the formal specification, abstracting away low-level assembly details from the engineer.
  3. Test program synthesis. The generator interprets the task description against the formal specification and emits executable test programs (typically in assembly language) that realize the requested test situations.

This separation of concerns—formal model, task description, and code generation—is what distinguishes the technique from manual or template-based test-program authoring.

Benefits

The technique yields two reported advantages:

  • Simplified configuration. Because verification goals are formulated as test situations in a high-level language rather than as raw instruction sequences, configuring the generation framework for a new target requires only adapting the formal specification and the task description, not rewriting low-level code.
  • Improved test coverage. Deriving test situations directly from the formal specification allows coverage criteria to be tied systematically to the model, raising the attainable level of test coverage compared with hand-crafted suites.

Applications

The technique has been applied to functional verification of microprocessors. It supports generation of assembly-language test programs whose scenarios are derived from architectural specifications of the processor under test. Industrial deployments have targeted verification of ARMv8 and MIPS64 microprocessor designs.

Implementations

The MicroTESK (Microprocessor TEsting and Specification Kit) framework is the principal implementation of this technique. MicroTESK consumes a formal specification of the microprocessor under verification and uses a Ruby-based task-description language to let engineers formulate verification goals as test situations; from these it generates assembly-language test programs. MicroTESK has been applied in industrial projects for ARMv8 and MIPS64 microprocessor verification.

Relationship to functional verification

Formal specification-driven test generation is one of the techniques that together constitute functional verification of microprocessors, where the primary objective is to exercise the design against its specification rather than its implementation details.

CITATIONS

5 sources
5 citations
[1] The technique uses formal specifications as a source of knowledge about the configuration of the system under verification. MicroTESK: a test program generator
[2] Generation tasks are described in a special Ruby-based language which allows formulating verification goals in terms of test situations derived from formal specifications. MicroTESK: a test program generator
[3] The approach simplifies configuring the framework and improves the level of test coverage. MicroTESK: a test program generator
[4] MicroTESK is a framework for generating test programs in assembly language for functional verification of microprocessors. MicroTESK: a test program generator
[5] MicroTESK has been successfully applied in industrial projects for verification of ARMv8 and MIPS64 microprocessors. MicroTESK: a test program generator