Automatic Failure Explanation in CPS Models

Ezio Bartocci, Niveditha Manjunath, Leonardo Mariani, Cristinel Mateis, Dejan Nickovic

Introduction

Cyber-Physical Systems (CPS), such as aircraft controllers and automotive transmissions, are notoriously difficult to debug due to their integration of discrete logic and continuous physical dynamics. While current tools are effective at identifying that a system has failed (falsification), they often function as "black boxes," providing little insight into why the failure occurred. Faults in these systems propagate through hundreds of variables over time, requiring engineers to spend days manually tracing signals through complex models to find a root cause.

CPSDebug is a new framework designed to automate this diagnostic process. By mining behavioral invariants from successful simulations and comparing them against failing ones, it narrows down hundreds of internal signals to a handful of suspicious components, providing a time-ordered narrative of fault propagation.

Methodology

The authors introduce CPSDebug, a three-phase workflow designed to "open the black box" of CPS failures:

The CPSDebug workflow consists of three main phases: Testing, Mining, and Explaining.
  1. Testing & Instrumentation: The tool automatically instruments a Simulink/Stateflow model to log every internal signal. It runs a test suite and uses Signal Temporal Logic (STL) to automatically label traces as "passing" or "failing."
  2. Property Mining: CPSDebug analyzes passing traces to infer "normal" behavior using Daikon, an invariant detection tool. It generates thousands of candidate properties (e.g., "Signal A is always less than Signal B") and retains only the statistically significant ones.
  3. Failure Explanation: When a failure occurs, the tool checks the failing trace against the mined properties. Any violation is flagged as an anomaly. To prevent information overload, k-means clustering groups these violations by time and location, producing a sequence of "snapshots" that show the fault's origin and its path through the system.

Evaluation and Case Studies

The approach was evaluated on two complex, industry-standard CPS models:

  • Aircraft Elevator Control System: A highly redundant model with 426 signals (361 internal), including hydraulic circuits, flight control units, and various sensors.
  • Automatic Transmission Control System: A model with 51 variables, featuring four lookup tables and two parallel finite state machines.
Schematic of the Aircraft Elevator Control System used as a case study.

The authors injected various faults into these models, such as sensor failures, low-pressure hydraulic leaks, and incorrect lookup table values, to validate the framework's ability to pinpoint root causes.

Key Insights

  • Learning from Success: Instead of predefined failure modes, the system learns what "correct" looks like from passing tests, making it adaptable to different models without manual rule-writing.
  • Dimensionality Reduction: To handle the massive data volume in CPS models, the authors used cross-correlation to prune redundant signals, reducing 361 variables to 121 in the aircraft case.
  • The "Story" of a Fault: By clustering violations chronologically, the tool creates a narrative. It can show, for example, how a sensor signal first became suspicious, leading to an unexpected controller state, and finally a safety requirement violation.

Results and Impact

  • Massive Scope Reduction: In the aircraft case study, CPSDebug reduced the number of signals an engineer needs to inspect by 90% to 96%.
  • High Accuracy: The tool successfully identified the root cause in 75% of the complex failure scenarios tested.
  • Professional Validation: Engineers from major automotive and simulation tool vendors confirmed that the visual feedback within the modeling environment was highly valuable for navigating complex models during post-mortem analysis.
  • Performance: While the mining phase is computationally heavy, the actual analysis of a failure happens in seconds, enabling an interactive debugging workflow.

Limitations and Future Work

Current limitations include a struggle with faults that only affect signal timing rather than value. Additionally, the property mining phase remains a bottleneck. Future research aims to optimize the mining process and extend support to heterogeneous components, such as physical modeling blocks (SimScape) common in industrial production.

Summary updated

Abstract

Debugging Cyber-Physical System (CPS) models can be extremely complex. Indeed, only the detection of a failure is insuffcient to know how to correct a faulty model. Faults can propagate in time and in space producing observable misbehaviours in locations completely different from the location of the fault. Understanding the reason of an observed failure is typically a challenging and laborious task left to the experience and domain knowledge of the designer. \n In this paper, we propose CPSDebug, a novel approach that by combining testing, specification mining, and failure analysis, can automatically explain failures in Simulink/Stateflow models. We evaluate CPSDebug on two case studies, involving two use scenarios and several classes of faults, demonstrating the potential value of our approach.
BibTeX
@inproceedings{bartocci2019automatic,
  author = {Ezio Bartocci and Niveditha Manjunath and Leonardo Mariani and Cristinel Mateis and Dejan Nickovic},
  title = {{Automatic Failure Explanation in CPS Models}},
  booktitle = {SEFM},
  year = {2019},
  doi = {10.1007/978-3-030-30446-1\_4},
}
Figure