[Paper Review] Automatic Test Data Generation and Model Checking with CHR
This paper presents a CHR-based toolchain for automatic test data generation and model checking in mission-critical satellite software, using constraint handling rules to detect infeasible paths and generate inputs that satisfy structural coverage criteria. It successfully identified a one-byte buffer overflow in a real satellite control function within seconds, which had previously evaded manual and static analysis.
We present an example for application of Constraint Handling Rules to automated test data generation and model checking in verification of mission critical software for satellite control.
Motivation & Objective
- To automate test data generation and model checking for mission-critical satellite control software.
- To detect infeasible execution paths early during test input generation.
- To integrate structural coverage goals with arithmetic constraints for precise test input synthesis.
- To verify correctness of complex embedded systems using constraint-based symbolic execution.
- To improve reliability of safety-critical software through automated verification and test generation.
Proposed method
- The approach uses Constraint Handling Rules (CHR) to implement a constraint solver for path construction, satisfiability checking, and constraint solving.
- A path constraint is constructed from the control flow graph of a function, representing conditions that must be satisfied for a specific path to be traversed.
- The system combines forward, backward, and splitting strategies for path construction to improve efficiency and detect infeasible paths early.
- Arithmetic constraints over bounded integers and floating-point types are handled via interval filtering and bidirectional propagation across types.
- The toolchain integrates with a dynamic random test tool (DCRTT) to validate findings on real satellite control software.
- Symbolic execution is used to analyze paths and detect potential buffer overflows by solving path constraints.
Experimental results
Research questions
- RQ1Can CHR be effectively used to automate test data generation and model checking in safety-critical embedded systems?
- RQ2How can infeasible paths be detected early during path construction using constraint-based techniques?
- RQ3To what extent can constraint-based symbolic execution detect subtle buffer overflows missed by manual and static analysis?
- RQ4How effective is the integration of structural coverage goals with arithmetic constraints in real-world mission-critical code?
- RQ5Can CHR-based solvers scale to complex, real-world embedded software with mixed data types and complex control flow?
Key findings
- The toolchain detected a one-byte buffer overflow in a real satellite control function that had previously evaded manual and static analysis.
- The defect was identified within one second by solving the path constraint with the goal of reaching the memcpy call under overflow conditions.
- The solution revealed that overflow occurs when next_entry_start == MAX_BUFFER_SIZE - length + 1, last_entry_start > 0, and last_entry_start < length - 1.
- The overflow could lead to corruption of volatile data and non-volatile program memory, potentially causing unresponsiveness.
- The defect was confirmed and fixed, and the random testing tool was extended to detect similar issues in future.
- The study demonstrates that CHR-based constraint solving is effective for symbolic execution and model checking in complex embedded systems.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.