Main Content

Coverage Filtering

When to Use Coverage Filtering

Use coverage filtering to facilitate a bottom-up approach to recording model coverage. If you have a large model, there can be design elements that intentionally do not record 100% coverage. You can also have several design elements that you require to record 100% coverage but that do not achieve 100% coverage. You can temporarily or permanently eliminate these elements from coverage recording to focus on a subset of objects for testing and modification.

You can then iterate more efficiently—focus on a small issue, fix it, and then move on to resolve the next small issue. Before recording coverage for the entire model, you can resolve missing coverage issues within individual parts of the model.

What Is Coverage Filtering?

Coverage filtering enables you to exclude certain model objects from model coverage reporting after you simulate your Simulink® model. You specify which objects you want to filter from coverage recording. There are two modes of filtering, Excluded and Justified.

Excluded objects do not contribute to coverage reports. After you specify the objects to exclude when you simulate your model, the coverage report does not record coverage for those objects.

Justified objects do contribute to coverage reports. After you specify the objects to justify when you simulate your model, the coverage report considers these blocks as achieving 100% coverage, and they appear light blue in the Coverage Summary.

Coverage report summary shows the model slvnvdemo_covfilt receives 64% decision coverage, 60% decision coverage, 50% MCDC coverage, and 74% execution coverage. The colored bars indicate some decision outcomes are justified and some remain unsatisfied.

In the Details section of the coverage report, justified objects show their coverage outcomes as ((covered outcomes + justified outcomes)/possible decisions).

Coverage report for the Stateflow state "Clipped" shows 100% decision coverage, 2 decision outcomes satisfied and 2 decision outcomes justified, along with 100% condition coverage, 5 condition outcomes satisfied and 7 condition outcomes justified.

To filter objects, see Create, Edit, and View Coverage Filter Rules and Creating and Using Coverage Filters.