MATLAB: Model Coverage Analysis for Logical Blocks

"conditionalcoveragedecisionlogical?Simulink Check

I have a simple model with 2 inputs and a logical AND block that I have set to collect coverage on, using the Structural Coverage level of "Decision"
However, when I run the model and analyze the coverage results, no "Decision" coverage is reported. Why is Simulink not reporting the decision coverage?

Best Answer

Decision Coverage in Simulink is defined as:
"Decision coverage analyzes elements that represent decision points in a model, such as a Switch block or Stateflow® states. For each item, decision coverage determines the percentage of the total number of simulation paths through the item that the simulation traversed."
Since the AND output is not driving a decision making block, there is no decision coverage to collect. By adding a switch that is being driven by the AND block, you can observe that the decision coverage is reported:
The AND block will need to have Condition coverage enabled to examine the level of coverage it has. Condition coverage verifies that all combinations of inputs are tested for a given Logical operator block.