Model Coverage for Stateflow Truth Tables
Types of Coverage in Stateflow Truth Tables
Simulink® Coverage™ reports model coverage for the decisions the objects make in a Stateflow® chart during simulation. The report includes coverage for the decisions the truth table functions make.
|For this type of truth table...||The report includes coverage data for...|
Conditions and only those actions that have decision points.
With the MATLAB for code generation action language, you can specify decision points in actions using control flow constructs, such as loops and switch statements.
To measure model coverage data for a Stateflow truth table, you must have a Stateflow license. For more information about Stateflow truth tables, see Obtain Cumulative Coverage for Reusable Subsystems and Stateflow® Constructs.
Analyze Coverage in Stateflow Truth Tables
If you have a Stateflow license, you can generate a model coverage report for a truth table.
Consider the following model.
The Stateflow chart contains the following truth table:
When you simulate the model and collect coverage, the model coverage report includes the following data:
The Coverage (this object) column shows
no coverage. The reason is that the container
object for the truth table function—the Stateflow chart—does not decide whether to execute the
ttable truth table.
The Coverage (inc. descendants) column shows coverage for the truth table contents. Coverage for the descendants in the Coverage (inc. descendants) column includes coverage for the conditions and decisions of the logical expressions represented by the truth table.
Coverage for the decisions and their individual conditions in the
ttable truth table function are as follows: