Fault-Model-Based Test Generation for Embedded Software

Michael Esser, Peter StrussIJCAI 2007

Modern vehicles have evolved into mobile data centers, powered by dozens of Electronic Control Units (ECUs) that manage everything from engine timing to fuel levels. As the complexity of this embedded software grows, traditional testing methods—like manual test case design or simple code coverage metrics—become insufficient. This research, originally presented at IJCAI-07, proposes a systematic framework to automate testing by treating software bugs as "fault models" and leveraging relational logic to generate high-precision test suites.

The Challenge of ECU Testing

Testing the "brains" of a car is a massive industrial bottleneck. While coverage metrics ensure every line of code is touched, they often fail to detect subtle logic errors. The authors identify a critical gap: the need for a rigorous, automated way to move from high-level requirements (like state charts) to test sequences that can prove the absence of specific, dangerous design flaws.

Methodology: From State Machines to Relational Logic

The proposed method bridges the gap between physical system modeling and software verification through a multi-step process:

1. Finite State Machine (FSM) Specification

The process begins by defining software requirements as a Finite State Machine. This model captures states, transitions, and the logic governing inputs (e.g., "car starts moving") and outputs (e.g., "refilling detected").

Finite State Machine (FSM) specification for a fuel level measurement system.

2. Relational Transformation

The core technical contribution is the transformation of the FSM into a modular relational representation. By breaking the logic into discrete components, the authors ensure that small changes in requirements only necessitate localized updates to the model. Key components include:

  • CState: Encodes the internal logic of a specific state.
  • CTrans: Encodes the logic for transitions between states.
  • C1Step: A wrapper representing a single discrete time step. Chaining these allows the system to model behavior over a sequence of events.
Modular relational representation using CState and CTrans components.

3. Fault Modeling and Test Generation

Instead of testing only for "correctness," the framework introduces fault models—intentional, systematic mutations of the original FSM (e.g., removing a condition from a transition). The system then uses an algorithm to find "discriminating test inputs." These are the shortest possible sequences of stimuli that cause the correct model and the faulty model to produce different observable outputs.

Case Study: Fuel Level Measurement

The researchers evaluated their method on a real-life industrial case study: a vehicle's fuel level measurement and computation system.

Key Results: * Automated Discrimination: The system successfully generated 36 different types of tests to distinguish a correct implementation from specific faulty ones. * Minimal Sequences: The algorithm identified the exact sequence of events (e.g., wait 4s → move → stop → wait 8s) required to trigger a discrepancy. * Diagnostic Power: By selecting appropriate fault models, the approach achieves classical benchmarks like state or transition coverage while providing significantly more diagnostic power than traditional methods.

Insights and Future Directions

By treating software logic with the mathematical rigor typically reserved for physical hardware, the authors enable the use of advanced automated reasoning tools. However, challenges remain. Defining a complete set of fault models is difficult because software bugs are limited only by a developer's creativity. Additionally, as the number of time steps increases, the relational model grows, leading to potential state explosion. Future work aims to better handle absolute time and integrate these formal methods more seamlessly into existing engineering workflows.

Summary updated

BibTeX
@inproceedings{esser2007fault,
  author = {Michael Esser and Peter Struss},
  title = {{Fault-Model-Based Test Generation for Embedded Software}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2007},
}
Figure