Documentation

Coverage Filter Rules and Files

What Is a Coverage Filter Rule?

A coverage filter rule is a rule that specifies a model object or set of objects that you want to exclude from coverage recording or that you want to justify for coverage.

Each coverage filter rule includes the following fields:

  • Name—Name or path of the object to filter from coverage

  • Type—Whether a specific object is filtered or all objects of a given type are filtered

  • Mode—Whether the object to be filtered is Excluded or Justified

    Coverage reports do not include Excluded blocks. The coverage reports assume that Justified blocks receive full coverage, but show that they are distinct from other covered blocks in the coverage report.

  • Rationale—An optional description that describes why this object is filtered from coverage

What Is a Coverage Filter File?

A is a collection of coverage filter rules. Each rule specifies one or more objects to exclude from coverage recording.

To apply the coverage filter rules during coverage recording, you first attach a coverage filter file to your model or to the current covdata data. After you attach the coverage filter file to the model, the specified objects are excluded from coverage each time that you simulate the model. You can attach a coverage filter file to several Simulink® models. However, a model can have only one attached coverage filter file.

If you attach the coverage filter rules to the current covdata data, you do not need to rerun the simulation to update new filtering rules in the coverage report. After you make changes, click Update Report in the Coverage Filter Viewer to update the report.

MATLAB® saves coverage filter files in the output folder defined in the coverage settings. The default name for a coverage filter file is <model_name>_covfilter.cvf.

If you use the default file name for the active model, and the coverage filter file exists on the MATLAB path, you see the coverage filter rules each time that you open the model. If another coverage filter file is already attached to that model, you do not see these coverage filters rules.

Was this topic helpful?