mcdcinfo

Display modified condition/decision coverage information for model object

Syntax

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

Description

coverage = mcdcinfo(cvdo, object) returns modified condition/decision 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 = mcdcinfo(cvdo, object, ignore_descendants) returns modified condition/decision coverage results for object, ignoring the coverage of its descendent objects if ignore_descendants is true (i.e., 1).

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

See MC/DC Analysis Table for more information about the data contained in these 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 modified condition/decision coverage for testObj, and execute testObj.

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

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

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

See Also

conditioninfo, decisioninfo

  


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