TL;DR
This paper introduces a novel approach to automatically generate "test case chains" for synchronous reactive systems. These chains are single, continuous test executions that cover multiple safety properties efficiently, minimizing overall testing time, which is crucial for on-target testing where system resets are costly.
What Problem Does This Paper Address?
Testing safety-critical embedded systems, common in automotive and avionics, is challenging. These systems are often synchronous and reactive, meaning they compute their next state and output based on their current state and inputs. A major hurdle is that testing specific features or safety properties often requires long input sequences to drive the system into a particular state. This is especially problematic in "on-target testing," where the system runs in its real-world environment, and resetting it between individual test cases is time-consuming and impractical. The goal is to create a single, cohesive test execution that covers a set of desired safety properties without excessive overhead.
Methods
The authors propose a three-step algorithm:
- Abstraction: They construct a "property K-reachability graph." This is a graph where nodes represent the safety properties (or initial/final states) and edges represent the minimum number of steps (bounded by K) required to transition between states satisfying these properties. This graph abstracts the complex system into a more manageable representation focused on property coverage.
- Optimization: They then find the shortest path in this abstract graph that covers all the specified properties. This is framed as a shortest path problem, potentially using algorithms like Floyd-Warshall and an Asymmetric Traveling Salesman Problem (ATSP) solver to find a minimal covering path.
- Concretization: Finally, they translate this abstract path back into a concrete sequence of inputs for the actual system, forming the test case chain.
The paper also addresses scenarios where a single chain might not be feasible or optimal. They introduce:
- Chain Repair: An iterative process to fix "broken chains" where an abstract path segment is not directly executable in the concrete system.
- Abstraction Refinement: A more advanced technique to split nodes in the abstraction graph when chain repair fails, making the abstraction more precise and enabling the discovery of feasible chains.
- Multiple Chains: Methods to generate multiple chains when a single chain covering all properties is impossible.
Datasets
The authors evaluated their approach using benchmarks derived from SIMULINK models, primarily from the automotive industry. These included:
- A simple cruise control model.
- A window controller.
- A car alarm system.
- An elevator model.
- A robot arm model.
They note that for some benchmarks, they had to re-engineer models from screenshots.
Key Insights and Ideas
- The Power of Abstraction for Test Chains: By abstracting the system into a property reachability graph, the problem of finding a test chain is transformed into a well-studied graph problem (shortest path), making it computationally tractable.
- Minimizing Reset Overhead: The core innovation is directly addressing the cost of resets in on-target testing by generating a single, continuous test execution.
- Handling Infeasibility: The techniques for chain repair and abstraction refinement are crucial. They demonstrate that even if an initial abstract path isn't directly executable, the system can often find a feasible (though potentially non-minimal) concrete test chain.
- Trade-off between Minimality and Feasibility: The paper highlights that while the abstract graph aims for minimal paths, the concrete execution might require slight deviations (longer paths) to remain feasible, especially with multi-state property triggers.
Key Results
- Their prototype tool, CHAINCOVER, generally succeeds in finding shorter test case chains compared to state-of-the-art tools like FSHELL, random testing, and KLEE.
- CHAINCOVER is also significantly faster than FSHELL.
- For some smaller specifications, random testing and KLEE also yielded good results, but their performance was highly variable and less consistent for larger or more complex benchmarks.
- The experimental results show that CHAINCOVER outperforms other tools in terms of both the length of generated test chains and the time taken for generation. For instance, on the "Robotarm 1" benchmark, CHAINCOVER generated a chain of length 25 in 185 seconds, while FSHELL took 2.8 seconds but generated a chain of length 24.6. However, for "Cruise 1," CHAINCOVER generated a chain of length 3 in 0.77 seconds, while FSHELL took 2.8 seconds for a chain of length 24.6.
Limitations and Future Work
- Deep Loops: The paper acknowledges that deep loops in the system can pose a problem for BMC-based methods, requiring manual reduction of loop bounds in some benchmarks. Future work could involve acceleration methods to handle counters more effectively.
- Optimality vs. Feasibility: While the abstract graph aims for minimality, the concrete test chains might not always be minimal due to feasibility constraints, especially with multi-state property triggers.
- Parallelization: The property K-reachability graph generation is identified as a candidate for parallelization, which could further boost the tool's performance.
- Early-Stage Testing: The current approach is primarily for late-stage testing (acceptance tests). Exploring how these chains can be used in earlier development phases and how they can be incrementally adapted after bug fixes is an open question.
- Handling Timing Information: While the approach can handle timing if explicitly expressed as counters, more complex timing mechanisms might require further investigation.
Summary updated