Products & Services Solutions Academia Support User Community Company

Learn more about Simulink Verification and Validation   

decisioninfo - Display decision coverage information for model object

Syntax

coverage = decisioninfo(cvdo, object)
coverage = decisioninfo(cvdo, object, ignore_descendants)
[coverage, description] = decisioninfo(cvdo, object)

Description

coverage = decisioninfo(cvdo, object) returns decision coverage results from the cvdata object cvdo for the model component specified by object.

coverage = decisioninfo(cvdo, object, ignore_descendants) returns decision coverage results for object, depending on the value of ignore_descendants.

[coverage, description] = decisioninfo(cvdo, object) returns decision coverage results and text descriptions of decision points associated with object.

Inputs

cvdo

cvdata object

ignore_descendants

Specifies to ignore the coverage of descendant objects if ignore_descendants is set to 1.

object

The object argument specifies an object in the model or Stateflow chart that received decision coverage. Valid values for object include the following:

Object SpecificationDescription

BlockPath

Full path to a model or block

BlockHandle

Handle to a model or block

slObj

Handle to a Simulink API object

sfID

Stateflow ID

sfObj

Handle to a Stateflow API object

{BlockPath, sfID}

Cell array with the path to a Stateflow chart and the ID of an object contained in that chart

{BlockPath, sfObj}

Cell array with the path to a Stateflow chart and a Stateflow object API handle contained in that chart

[BlockHandle, sfID]

Array with a Stateflow chart handle and the ID of an object contained in that chart

Outputs

coverage

The value of coverage is a two-element vector of the form [covered_outcomes total_outcomes].coverage is empty if cvdo does not contain decision coverage results for object. The two elements are:

covered_outcomesNumber of decision outcomes satisfied for object
total_outcomesNumber of decision outcomes for object

description

description is a structure array containing the following fields:

decision.textString describing a decision point, e.g., 'U > LL'
decision.outcome.textString describing a decision outcome, i.e., 'true' or 'false'
decision.outcome.
executionCount
Number of times a decision outcome occurred in a simulation

Examples

Open the slvnvdemo_cv_small_controller model and create the test specification object testObj. Enable decision coverage for testObjand execute testObj using cvsim. Use decisioninfo to retrieve the decision coverage results for the Saturation block and determine the percentage of decision outcomes covered:

mdl = 'slvnvdemo_cv_small_controller';
open_system(mdl)
testObj = cvtest(mdl)
testObj.settings.decision = 1;
data = cvsim(testObj)
blk_handle = get_param([mdl, '/Saturation'], 'Handle');
cov = decisioninfo(data, blk_handle)
percent_cov = 100 * cov(1) / cov(2)

Alternatives

To collect and display decision coverage results:

  1. Open the model.

  2. In the Model Editor, select Tools > Coverage Settings.

  3. On the Coverage tab, under Coverage Metrics, select Decision Coverage.

  4. Click OK to close the Coverage Settings dialog box.

  5. Simulate the model and review the results.

See Also

conditioninfo | cvsim | mcdcinfo | sigrangeinfo | tableinfo

How To

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

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