Retrieve condition coverage information from cvdata
object
coverage = conditioninfo(cvdo, object)
coverage = conditioninfo(cvdo, object, mode)
coverage = conditioninfo(cvdo, object, ignore_descendants)
[coverage, description]
= conditioninfo(cvdo, object)
returns
condition coverage results from the coverage
= conditioninfo(cvdo
, object
)cvdata
object cvdo
for
the model component specified by object
.
returns
condition coverage results from the coverage
= conditioninfo(cvdo
, object
, mode
)cvdata
object cvdo
for
the model component specified by object
for the
simulation mode mode
.
returns
condition coverage results for coverage
= conditioninfo(cvdo
, object
, ignore_descendants
)object
, depending
on the value of ignore_descendants
.
[
returns
condition coverage results and textual descriptions of each condition
in coverage
, description
]
= conditioninfo(cvdo
, object
)object
.
|
| ||||||||||||||||||||||||||||||||||
|
An object in the Simulink® model or Stateflow® diagram
that receives decision coverage. Valid values for
When specifying an S-function block, valid values for
For coverage data collected during Software-in-the-Loop (SIL)
mode or Processor-in-the-Loop (PIL) simulation mode, valid values
for
| ||||||||||||||||||||||||||||||||||
|
The
| ||||||||||||||||||||||||||||||||||
|
Logical value that specifies whether to ignore the coverage of descendant objects
|
|
The value of
| ||||||||||||
|
A structure array with the following fields:
|
The following example opens the slvnvdemo_cv_small_controller
example
model, creates the test specification object testObj
,
enables condition coverage for testObj
, and executes testObj
.
Then retrieve the condition coverage results for the Logic block (in
the Gain subsystem) and determine its percentage of condition outcomes
covered:
mdl = 'slvnvdemo_cv_small_controller'; open_system(mdl) testObj = cvtest(mdl) testObj.settings.condition = 1; data = cvsim(testObj) blk_handle = get_param([mdl, '/Gain/Logic'], 'Handle'); cov = conditioninfo(data, blk_handle) percent_cov = 100 * cov(1) / cov(2)
Use the coverage settings to collect condition coverage for a model:
Open the model for which you want to collect condition coverage.
In the Model Editor, select Model Settings on the Modeling tab.
On the Coverage pane of the Configuration Parameters dialog box, select Enable coverage analysis.
Under Coverage metrics, select Condition as the structural coverage level.
Click OK to close the Configuration Parameters dialog box and save your changes.
Simulate the model by clicking the Run button and review the results.
complexityinfo
| cvsim
| decisioninfo
| getCoverageInfo
| mcdcinfo
| overflowsaturationinfo
| sigrangeinfo
| sigsizeinfo
| tableinfo