conditioninfo - Display condition coverage information for model object

Syntax

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

Description

coverage = conditioninfo(cvdo, object) returns condition coverage results from the cvdata object cvdo for the model component specified by object. See Specifying a Model Object for more information about the object argument. The value of coverage is a two-element vector of form [covered_outcomes total_outcomes], the elements of which are defined as follows:

coverage = conditioninfo(cvdo, object, ignore_descendants) returns condition coverage results for object, ignoring the coverage of its descendent objects if ignore_descendants is true (i.e., 1).

[coverage, description] = conditioninfo(cvdo, object) returns condition coverage results and textual descriptions of each condition in object. description is a structure array containing the following fields:

Specifying a Model Object

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

Object SpecificationDescription

BlockPath

Full path to a Simulink model or block

BlockHandle

Handle to a Simulink 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 block and the ID of an object contained in that chart

{BlockPath, sfObj}

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

[BlockHandle, sfID]

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

Example

The following commands open the slvnvdemo_cv_small_controller demo model, create the test specification object testObj, enable condition coverage for testObj, and execute testObj.

mdl = 'slvnvdemo_cv_small_controller';
open_system(mdl)
testObj = cvtest(mdl)
testObj.settings.condition = 1;
data = cvsim(testObj)

Afterward, issue the following commands to retrieve the condition coverage results for the Logic block (in the Gain subsystem) and determine its percentage of condition outcomes covered.

blk_handle = get_param([mdl, '/Gain/Logic'], 'Handle');
cov = conditioninfo(data, blk_handle)
percent_cov = 100 * cov(1) / cov(2)

See Also

decisioninfo, mcdcinfo

  


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