| SystemTest™ | ![]() |
The model coverage feature provided by the Simulink Verification and Validation software allows you to generate coverage analysis metrics for a Simulink model, which can be incorporated directly into your SystemTest test. Model coverage metrics allow you to validate your model by identifying unexecuted subsystems, unselected switch positions, or untaken conditional transition paths. You can generate a cumulative coverage report, specify individual coverage options, or inherit a model's coverage settings.
Note To use the model coverage feature, you need a license for Simulink Verification and Validation. |
The following basic steps describe the typical work flow to use this feature:
Use an existing Simulink element or add one by clicking the New > Test Element button and selecting Simulink.
On the Properties pane, browse for your Simulink model using the browse button next to the Simulink model field.
To see an example, you can run the Signal Builder demo by typing systemtest SignalBuilderDemo in MATLAB.
Configure the Simulink element as described in this chapter, using the Mappings tab of the Properties pane to define model overrides and map Simulink data to test variables.
On the Model Coverage tab, which appears if you have a license for the Simulink Verification and Validation software, select the Enable model coverage check box. The following figure shows the Signal Builder demo.

If you want to use the model coverage settings you already have on the Simulink model, select the Inherit coverage metric settings from the model option. Then go to step 11.
If you want to override the existing settings, select the Override model coverage metric settings option.
Select Coverage for this model: <modelname>.

Click the Select Subsystem button in the Overridden Coverage Metrics section to specify the root of your coverage data.

If you have one or more referenced models and you want coverage for them, select the Coverage for referenced models option.
Then click the Select Models button to select the referenced model(s) for coverage. Make your selection in the Select Models for Coverage Analysis dialog box and click OK.
Note that you can record coverage only for referenced models that operate in Normal mode. You cannot enable coverage for referenced models operating in Accelerated mode.
In the Coverage Metrics area, select the types of coverage your test requires. The selected coverage types will be generated and shown in the coverage report.

Use the Map Coverage Data to SystemTest Variables field to map coverage metrics to test variables. Click New Mapping and select Full Coverage Instrumentation Path if you want coverage data below the root you specified under Coverage for this model, or select Select Path to Map if you want to pick an alternate coverage path, which must be within the coverage instrumentation path. If you select the latter, your Simulink model will open and you can select a block to specify an alternate root for your coverage path.
Select the Metric you want to map to a test variable, and specify the test variable to use under the SystemTest Data column.

Run your test.
View the coverage report by clicking the link in the Run Status pane.

For more information on the model coverage feature, see Using Model Coverage in the Simulink Verification and Validation documentation.

![]() | Overriding Inport Block Signals | Using Simulink Design Verifier Data Files in a Test | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |