Adaptive Testing for Specification Coverage in CPS Models

Ezio Bartocci, Roderick Bloem, Benedikt Maderbacher, Niveditha Manjunath, Dejan Nickovic

This paper presents a novel framework for the automated testing of Cyber-Physical Systems (CPS). By combining formal logic, game theory, and numerical optimization, the authors provide a way to systematically explore a system's behavior to ensure it meets complex requirements, even when those systems are as complex as aircraft control models.

TL;DR

The authors introduce an adaptive testing method that uses "cooperative reachability games" and Particle Swarm Optimization to systematically explore Signal Temporal Logic (STL) specifications. This approach significantly outperforms random and standard falsification testing in achieving high specification coverage for complex systems like MATLAB Simulink models.

What Problem Does This Paper Address?

Ensuring the safety and correctness of Cyber-Physical Systems (CPS)—like autonomous cars or medical devices—is notoriously difficult. While formal verification (mathematically proving a system is correct) is ideal, it often fails to scale to the massive complexity of real-world designs.

Engineers typically rely on simulation-based testing. A popular method is falsification-based testing, which uses Signal Temporal Logic (STL) to describe requirements and optimization algorithms to find "bugs" (inputs that violate the spec). However, falsification has a major blind spot: it usually stops at the first bug found and provides no information about how much of the overall specification has actually been "covered" or exercised. This paper addresses the need for specification coverage, ensuring that a test suite explores all meaningful parts of a requirement, not just the easiest path to a failure.

Methods

The authors propose a multi-stage pipeline for adaptive testing:

  1. Translation: They translate an STL specification into a Symbolic Automaton (SA). This automaton represents the different states and transitions the system must go through to satisfy or violate the requirement. The symbolic automaton represents the logical flow of the system requirements.

  2. Cooperative Reachability Games: They treat testing as a game between the "tester" (providing inputs) and the "system" (producing outputs). Unlike standard adversarial games, these are cooperative: the tester tries to find inputs that allow the system to reach a specific target state in the automaton.

  3. Adaptive Steps with PSO: To execute the strategy, the tester must steer the system. The authors use Particle Swarm Optimization (PSO)—a meta-heuristic search algorithm—to find the specific input values at each time step that nudge the system toward the desired state.
  4. Feedback Loop: The process is summarized in the overview below. The tool selects a "Test Goal" (an unvisited state in the automaton), solves the game to find a strategy, and uses the optimizer to generate a test case. Overview of the adaptive testing framework.
The symbolic automaton represents the logical flow of the system requirements.
Overview of the adaptive testing framework.

Datasets

The approach was evaluated on:

  • Illustrative Stateless Systems: Simple mathematical models used to demonstrate how the tool identifies specific implementation choices.
  • Aircraft Elevator Control System (AECS): A high-fidelity benchmark from the avionics domain. This is a complex MATLAB Simulink model featuring 426 internal state variables, representing a significant challenge for traditional verification tools.

Key Insights and Ideas

  • Cooperation over Conflict: Traditional testing often views the system as an adversary. By framing it as a cooperative game, the authors can systematically guide the system into "hard-to-reach" corners of the specification that random testing would likely miss.
  • Coverage as a Diagnostic Tool: The authors show that low coverage isn't always a failure of the test generator. If a certain part of the specification (a transition in the automaton) cannot be reached despite intense optimization, it strongly suggests that the system implementation has made a specific design choice that excludes that behavior.
  • Incremental Falsification: Instead of trying to find a complex bug all at once (global optimization), the automaton allows the tool to build a violating trace step-by-step, making the search process much more efficient.

Key Results

In the Aircraft Elevator Control System (AECS) case study:

  • Efficiency: The adaptive approach found a specification violation in just 32 simulations (taking ~121 seconds). In contrast, standard falsification testing failed to find a violation even after 12,000 simulations.
  • Coverage: Adaptive testing achieved 46% location coverage of the 241-state automaton. Random testing, given the same simulation budget, managed only 4% coverage.
  • Scalability: The tool successfully handled a model with over 400 state variables, demonstrating its readiness for realistic engineering tasks.

Limitations and Future Work

  • Heuristic Nature: Because the method relies on PSO (a heuristic optimizer), failing to reach a state is not a formal proof that the state is unreachable. It only provides a high degree of confidence.
  • State Explosion: While more scalable than formal verification, very large and complex STL specifications could still lead to large symbolic automata, potentially slowing down the game-solving phase.
  • Future Directions: The authors suggest extending the method to handle more complex coverage metrics and integrating it more deeply into standard industrial model-based design workflows.

Summary updated

BibTeX
@inproceedings{bartocci2021adaptive,
  author = {Ezio Bartocci and Roderick Bloem and Benedikt Maderbacher and Niveditha Manjunath and Dejan Nickovic},
  title = {{Adaptive Testing for Specification Coverage in CPS Models}},
  booktitle = {ADHS},
  year = {2021},
  doi = {10.1016/j.ifacol.2021.08.503},
}
Figure