code-based test generation
Code-based test generation, as described in the cited work on processor validation, is an automatic test generation method for functional processor descriptions. It analyzes the control flow of the description and uses constraint solving to compute test vectors that exercise execution paths.
Motivation
The method is presented for validation of microprocessor functional models. In the paper, these simulation models are treated as important development and verification artifacts, and their quality is described as capable of strongly affecting project timing.
Core idea
For a program P, the global variable definitions denote the input values of the description. A test vector is treated as a pair <v, P(v)>, where v assigns the inputs and P(v) gives the expected outputs.
Because the processor descriptions are largely composed of decoding logic, with many branches and switch statements on codeop, the methodology adopts a path coverage criterion. The paper explicitly states that path coverage is the closest quantitative approximation of test quality in this context.
Method
The strategy is split into two phases:
- Generate one constraint store for each path in the description.
- Analyze or solve that store to generate concrete values for the test vector corresponding to that path.
The implementation described in the paper uses the STTVC toolchain. It translates descriptions written in the x language into a C "code explorer" linked with the STCS solver library. The translation step is described as a purely static analysis, mainly involving type analysis.
Role of constraint solving
The approach is explicitly based on constraint solving techniques. The paper also states that the dedicated solver is designed to handle constraints arising from constructs typical of processor descriptions, and discusses constraints related to expressions, bit manipulations, and array management.
Literature context
The concept is the central method presented in Code-based Test Generation for Validation of Functional Processor Descriptions.