TL;DR
This paper introduces an automated approach for testing complex hybrid Simulink/Stateflow controllers, commonly used in automotive systems. By combining exploration and exploitation techniques, it helps engineers visualize controller behavior, identify risky input regions, and generate worst-case test scenarios, leading to increased confidence in model reliability.
What Problem Does This Paper Address?
Testing embedded control software, particularly in the Cyber-Physical Systems (CPS) domain, presents unique challenges. Unlike traditional software, these systems deal with continuous-time signals and often have a large number of input variables and configuration parameters. This makes it difficult for engineers to thoroughly test controllers and ensure they meet requirements, especially under edge-case conditions. Existing tools often require complex model translations, which can be time-consuming and error-prone. The authors aim to address this by providing an automated, black-box testing approach that directly works with Simulink/Stateflow models.
Methods
The paper proposes a two-step approach:
- Exploration: This phase involves a random search across the entire input space of the controller. The goal is to visualize the controller's behavior and identify "critical" regions where requirements might be violated or anti-patterns (like instability or discontinuity) might occur.
- For 2D input spaces, Heatmap diagrams are used to visually represent the objective function values (e.g., requirement deviation or anti-pattern severity) across different input combinations.
- For higher-dimensional input spaces, Regression trees are employed to partition the input space and identify important variables and their ranges.
- Exploitation: Once critical regions or partitions are identified, a meta-heuristic search algorithm (specifically, Hill-Climbing is mentioned) is used to explore these areas more deeply. This step aims to generate specific test scenarios that maximize the likelihood of failures or violations, effectively finding "worst-case" scenarios.
The approach defines objective functions that quantify requirement satisfaction or the presence of anti-patterns. These functions are derived from formal temporal logic specifications for closed-loop controllers or from identified anti-patterns for open-loop controllers.
Datasets
The paper evaluates its approach on two case studies:
- Electro-Mechanical Braking (EMB) model: A public, benchmark model from Bosch research, representing a realistic automotive system. This model is implemented in Matlab/Simulink and includes both open-loop (state machine) and closed-loop (PID) controllers.
- M model: A proprietary industrial Simulink model from an automotive partner company, used for vehicle automatic transmission control. This model has 24 input variables.
Key Insights and Ideas
- Visualizing the "Risk Landscape": Heatmaps and regression trees provide engineers with a much-needed visual understanding of how different input combinations affect controller behavior, highlighting areas of high risk. This moves beyond simply finding individual bugs to understanding the conditions under which failures are likely.
- Bridging Formal and Practical Testing: The method effectively translates formal requirements (like temporal logic formulas) into quantitative objective functions that can be optimized by search algorithms, making formal verification more practical.
- Identifying "Anti-Patterns": The introduction and use of specific anti-patterns (instability, discontinuity, growth to infinity) for open-loop controllers offer a systematic way to detect common failure modes in systems without explicit formal requirements.
- Black-Box Efficiency: The approach's black-box nature, meaning it doesn't require model translation, significantly reduces the overhead and complexity compared to many existing verification techniques.
- Engineer Confidence: The ability to generate concrete worst-case scenarios and visualize risk areas gives engineers greater confidence in the robustness and reliability of their complex controllers.
Key Results
- The approach was successfully applied to both a public benchmark (EMB) and a proprietary industrial model (M).
- For the EMB model, testing against property $\phi_1$ (related to braking contact time) showed a relative improvement of about 12% in finding worst-case scenarios using the exploitation step compared to exploration alone.
- Testing for anti-patterns on the EMB model yielded relative improvements of around 5-24% for instability, discontinuity, and growth to infinity.
- For the industrial M model with 24 inputs, the approach identified significant input variables for instability, discontinuity, and growth to infinity, with relative improvements of 10% and 8% for discontinuity and growth to infinity, respectively.
- The execution times for generating exploration visualizations (Heatmaps/regression trees) ranged from minutes to several hours, while exploitation (finding worst-case scenarios) took from minutes to an hour per scenario.
Limitations and Future Work
- Simulation-Based: The approach relies on simulation, meaning its effectiveness is tied to the accuracy of the Simulink models themselves.
- Parameter Ranges: The effectiveness of the exploration and exploitation steps depends on engineers providing reasonable ranges for input variables and configuration parameters.
- Future Work: The authors suggest that further research could explore more sophisticated search algorithms for the exploitation step and investigate how to automatically derive objective functions from less formal requirement specifications. They also highlight the potential for applying this approach to even larger and more complex industrial models.
Summary updated