Systematic testing of your Simulink® design ensures that you have accounted for both intended and unintended behavior before generating code. During requirements-based simulation testing, parts of your design might not be exercised due to subtle design errors, incomplete tests, or missing requirements. Model test coverage helps you identify these gaps in testing by measuring how much of your Simulink design has been exercised during simulation.
A common cause of incomplete model test coverage during requirements-based testing is missing requirements. This type of missing model test coverage is often a result of design elements that cannot be traced to a higher-level requirement. Collecting model test coverage helps you account for this situation. This article describes an example in which testing of a triplex selection algorithm design is found to be incomplete due to a missing requirement.
Triplex Selection Algorithm: Overview and Requirements
Triplex signal selection algorithms are commonly used in aerospace control system software. In triplex signal selection, a single “voted” signal is selected from three independent sensors for use in the control of the aircraft. A sensor is “valid” if there are no faults detected for that sensor.
For this example, the aircraft Airspeed signal will be selected. The requirements for the Airspeed signal selection algorithm are as follows:
- HLR_1 Selecting Airspeed Signal for Triple Sensors: The flight control computer shall select the middle value of the three sensors when three Airspeed signals are valid.
- HLR_2 Selecting Airspeed Signal for Dual Sensors: The flight control computer shall select the average of the two sensors when only two Airspeed signals are valid.
- HLR_3 Selecting Airspeed Signal of Single Sensor: The flight control computer shall select the valid signal when only one Airspeed signal is valid.
Figure 1 shows the Simulink implementation of these requirements.