To create and run test cases, model coverage provides two MATLAB® commands,
cvtest command creates test cases that the
runs. (See Run Tests with cvsim.)
You can also run the coverage tool interactively:
In the Simulink® model window, select Analysis > Coverage > Settings.
The Coverage Pane of the Configuration Parameters dialog box opens.
Select Enable coverage analysis, which enables the coverage settings.
Under Coverage metrics, select the types of coverage that you want to record in the coverage report.
In the Simulink Editor, select Simulation > Run to start simulating the model.
If you specify to report model coverage in the Results Pane of the
Configuration Parameters dialog box, Simulink Verification and Validation™ saves
coverage data for the current run in the workspace object
cumulative coverage data in
by default. Simulink Verification and Validation also saves these
results to a
.cvt file by default. At the end of
the simulation, the data appears in an HTML report that opens in a
browser window. For more information on coverage data settings, see Specify Model Coverage Options.
Note: You cannot run simulations if you select both model coverage reporting and acceleration options. If you select Simulation > Mode > Accelerator in the Simulink Editor, Simulink does not record coverage.
You cannot select both block reduction and conditional branch input optimization when you perform coverage analysis because they interfere with coverage recording.