Using Model Coverage

Basic Workflow for Using Model Coverage

To develop effective tests with model coverage,

  1. Develop one or more test cases for your model (see Creating and Running Test Cases).

  2. Run the test cases to verify that the model behavior is correct.

  3. Analyze the coverage reports produced by the Simulink® Verification and Validation™ software.

  4. Using the information in the coverage reports, modify the test cases to increase their coverage or add new test cases that cover areas not covered by the current set of test cases.

  5. Repeat the preceding steps until you are satisfied with the coverage of your test set.

Creating and Running Test Cases

Model coverage provides two MATLAB commands, cvtest and cvsim, for creating and running test cases. The cvtest command creates test cases to be run by the cvsim command (see Creating Tests with cvtest and Running Tests with cvsim).

You can also run the coverage tool interactively as follows:

  1. From the Simulink® Tools menu, select Coverage Settings.

    The Coverage Settings dialog box appears.

    The Coverage Settings dialog box has four tabs. The Coverage tab is displayed by default.

  2. Select Coverage for this model.

    By default, this setting is disabled. When you select it, the Select Subsystem button is enabled along with the check boxes of the Coverage metrics section, as shown.

    Selecting Coverage for this model also enables fields on the other tabs of the Coverage Settings dialog box.

  3. Select the coverages you want to appear in the coverage report.

    For a complete inventory of coverage selections in all four tabs of the Coverage Settings dialog box, see Specifying Model Coverage Reporting Options.

  4. Select OK to close the dialog box.

  5. Select Start from the Simulation menu or the Start button on the Simulink toolbar to start simulation of the model.

    By default, the Simulink Verification and Validation software saves coverage data for the current run in the workspace object covdata and cumulative coverage data in covCumulativeData. This data appears in an HTML report that is displayed automatically at the end of simulation.

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS