How to Efficiently Conduct Fault Injection Testing
Abstract: Shifting fault injection testing forward is not only an improvement in testing efficiency but also an important guarantee for balancing R&D costs and cycles.
With the rapid development of automotive driver assistance technology, the driving experience and travel efficiency have been greatly improved. However, accidents frequently appearing in hot searches due to driver assistance systems also reflect public concerns about their safety. To ensure safety, the ISO 26262 functional safety standard requires different testing methods for automotive electronic and electrical systems, and fault injection testing is an important means to verify system safety.
From the perspective of generation mechanism, fault scenarios mainly include four categories: communication data faults, communication link faults, physical link faults, and power supply faults. To verify the system's safe response under a fault, engineers first think of real-vehicle or simulation testing, but the actual implementation is difficult due to issues such as testing cycle, cost control, site restrictions, and testing safety.
Shifting fault testing forward to the model phase and reusing and supplementing test cases in subsequent phases is the key to improving testing efficiency. The application of the TPT platform will be described below.
Fault Injection Testing in the Model Phase
In the model development phase, fault injection testing simulates peripheral signal anomalies. This allows problems to be discovered early, is easy to trace, and has low costs.
In addition, TPT can also be used to simulate internal signal anomalies in the model algorithm to check the robustness of the algorithm.
Fault Injection Testing in the HiL Phase
TPT supports integration with HiL testing software (such as CANoe). Through signal mapping, test cases from the MiL phase can be reused, and board card signals can be further imported to supplement the injection capabilities for communication link and electrical faults, building a complete automated fault testing process.
Next, we will use a light control model to introduce how TPT conducts fault injection testing.
Test Function Introduction
The functional requirement is that when the switch (light_switch) is in the automatic (2) state, if the light intensity (light_intensity) is greater than 70 and lasts for more than 3 seconds, the headlight (headlight) should turn off.
01: Fault Injection Testing in the Model Phase
Peripheral Signal Anomaly
Test Scenario: Simulate a data anomaly in the light_switch signal, where the data changes to unknown (3) in the automatic state.

Switch Signal Anomaly
In the test results, it can be seen that when the light_switch signal input is an abnormal value, the counter stops increasing, and the headlight immediately becomes 0, indicating that the system correctly responds to the external input anomaly.

Switch Signal Anomaly Test Result
Internal Signal Anomaly
TPT supports fault injection for intermediate model variables. Users only need to select the target element in the test framework and import it to the platform as a Server Function to directly call it in the test case, eliminating the need to manually build a fault model. This method supports the injection of various faults such as constant values, null values, gain, and noise, and can be combined with Python scripts to realize complex scenarios.
Tips: Fault injection test cases for intermediate model variables cannot be reused in the HiL phase.

TPT Server function

Fault Injection Position
Test Scenario: Simulate an anomaly in the processed data of the light_intensity signal, where null values appear in multiple places.
The test case calls the Python library to assign a null value to the signal based on a random number condition, simulating a data anomaly.

Model Internal Signal Fault Injection
From the test results, it can be seen that null values appear in multiple places for the light_intensity signal, causing the counter timer to constantly reset, thus failing to meet the $t>3s$ condition, and consequently, the headlight cannot turn off, indicating that the system needs additional processing mechanisms.

Fault Injection Result
02: Fault Injection Testing in the HiL Phase
Test Case Reuse
In the HiL testing phase, taking CANoe as an example, mapping is performed when importing CANoe project signals to reuse the earlier test cases.

Signal Mapping
The signals in the test case are automatically converted to HiL phase signals after mapping.

Mapped Test Case
The result of running the test case is consistent with the MiL test result.

Reused Test Case Run Result
Electrical Fault Injection Testing
By integrating board cards such as VT2820, TPT can simulate electrical faults. After the user imports the board card signals to the platform, test cases can be written to simulate hardware anomalies such as sensor open circuits or short circuits.

Import Board Card Signals
The board card signal VTS::M2_Ch1::Relay is used to control the transmission on/off status, simulating a sensor failure fault.

Simulate Sensor Fault
Fault injection testing, as a key part of functional safety verification, can effectively expose potential risks in the system under abnormal conditions and enhance system robustness and reliability. By introducing fault injection early in the model phase and combining TPT's multi-platform capabilities for test case development and reuse, engineers can more efficiently build a fault testing system that covers the entire lifecycle, thereby discovering and fixing defects early in system development and providing a solid guarantee for creating safe and reliable intelligent driving systems.
Shifting fault injection testing forward is not only an improvement in testing efficiency but also an important guarantee for balancing R&D costs and cycles. Polelink as a Chinese domestic partner of Synopsys, always provides testing solutions tailored to industry needs with professional TPT technical support experience. We will work with you to jointly promote the improvement of quality and efficiency in automotive electronics testing and inject new vitality into industry development.

