Main Content

Model Coverage Objectives for Test Generation

Test cases are generated to drive your model to satisfy condition, decision, modified condition/decision (MCDC), and custom coverage objectives. But, if your model does not have any of these objectives, then Simulink® Design Verifier™ generates a test case that represents a basic simulation of your model. The test inputs satisfy minimum or maximum constraints on input ports and intermediate signal values satisfy constraints specified by the Test Condition blocks in the model.

Decision

Decision coverage in Simulink Design Verifier examines blocks and Stateflow® states that represent decision points in a model. For instance, the Switch block involves the decision about whether the control input is greater than a threshold value. For more information, see Model Objects That Receive Coverage (Simulink Coverage).

To enable decision coverage, under Design Verifier > Test Generation, for Model coverage objectives, select one of the following:

  • Decision

  • Condition Decision

  • MCDC

For each decision in your model, Simulink Design Verifier generates test cases that satisfy the coverage objective. For more information, see Decision Coverage (DC) (Simulink Coverage).

Condition

Condition coverage examines blocks that output the logical combination of their inputs and Stateflow transitions. For more information, see Model Objects That Receive Coverage (Simulink Coverage).

To enable condition coverage, under Design Verifier > Test Generation, for Model coverage objectives, select one of the following:

  • Condition Decision

  • MCDC

For each input to a logical block and each condition in a transition, Simulink Design Verifier generates test cases that satisfy the coverage objective. For more information, see Condition Coverage (CC) (Simulink Coverage). .

MCDC

Modified condition decision coverage examines blocks that output the logical combination of their inputs and Stateflow transitions. For more information, see Model Objects That Receive Coverage (Simulink Coverage).

To enable MCDC coverage, under Design Verifier > Test Generation, for Model coverage objectives, select MCDC.

For each input to a logical block and each condition in a transition, Simulink Design Verifier generates test cases that satisfy the coverage objective. For more information, see MCDC Coverage for Stateflow Charts (Simulink Coverage).

For information on how MCDC test generation in Simulink Design Verifier can deviate from MCDC coverage recorded by Simulink Coverage™, see Modified Condition and Decision Coverage in Simulink Design Verifier.

Enhanced MCDC

Enhanced MCDC is an extension of modified condition decision coverage. For a test block, enhanced MCDC generates test cases that avoid masking effects from downstream blocks, so that the test block has an effect on the output.

To enable enhanced MCDC coverage, under Design Verifier > Test Generation, for Model coverage objectives, select Enhanced MCDC. For more information, see Enhanced MCDC Coverage in Simulink Design Verifier.

Relational Boundary

Relational boundary coverage examines blocks that have an explicit or implicit relational operation and Stateflow transitions. For more information, see Model Objects That Receive Coverage (Simulink Coverage). Test generation for relational boundary coverage is not supported for If and Fcn blocks.

To enable relational boundary coverage, under Design Verifier > Test Generation, select Include relational boundary objectives.

For each relational operation in the model, Simulink Design Verifier generates test cases that satisfy the coverage objective. For more information, see Relational Boundary Coverage (Simulink Coverage).

Note

  • In case your model does not have conditions, decisions, or custom test objectives, then Simulink Design Verifier will generate a test case that represents a basic simulation of your model. The test inputs will satisfy min/max constraints on input ports and intermediate signal values will satisfy constraints specified by the Test Condition blocks in the model.

  • Simulink Design Verifier does not generate test cases for relational boundary objectives of MinMax block.