Retrieve cyclomatic complexity coverage information from cvdata
object
complexity = complexityinfo(cvdo, object)
complexity = complexityinfo(cvdo, object, mode)
returns
complexity coverage results from the complexity
= complexityinfo(cvdo
, object
)cvdata
object cvdo
for
the model component object
.
returns
complexity coverage results from the complexity
= complexityinfo(cvdo
, object
, mode
)cvdata
object cvdo
for
the model component object
for the simulation
mode mode
.
|
| ||||||||||||||||||||||||||||||||||||
|
The
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
|
|
If If
If |
Open the sldemo_fuelsys
model and create
the test specification object testObj
. Enable decision,
condition, and MCDC coverage for sldemo_fuelsys
and
execute testObj
using cvsim
.
Use complexityinfo
to retrieve cyclomatic complexity
results for the Throttle subsystem. The Throttle subsystem itself
does not record cyclomatic complexity coverage results, but the contents
of the subsystem do record cyclomatic complexity coverage.
mdl = 'sldemo_fuelsys'; open_system(mdl); testObj = cvtest(mdl) testObj.settings.decision = 1; testObj.settings.condition = 1; testObj.settings.mcdc = 1; data = cvsim(testObj); blk_handle = get_param([mdl, ... '/Engine Gas Dynamics/Throttle & Manifold/Throttle'],... 'Handle'); coverage = complexityinfo(data, blk_handle); coverage
Use the coverage settings to collect and display cyclomatic complexity coverage results in the coverage report:
Open the model.
In the Simulink 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 MCDC as the structural coverage level.
Click OK to close the Configuration Parameters dialog box and save your changes.
Simulate the model and review the results in the HTML report.
conditioninfo
| cvsim
| decisioninfo
| getCoverageInfo
| mcdcinfo
| sigrangeinfo
| sigsizeinfo
| tableinfo