Main Content

sldvgencov

Analyze models to obtain missing model coverage

Description

[status, cvdo] = sldvgencov(model, options, showUI, startCov) analyzes the model model by using the sldvoptions object options.

[status, cvdo] = sldvgencov(block, options, showUI, startCov) analyzes the atomic subsystem block by using the sldvoptions object options.

[status, cvdo, filenames] = sldvgencov(model, options, showUI, startCov) analyzes the model and returns the file names that the software creates in filenames.

example

[status, cvdo, filenames, newmodel] = sldvgencov(block, options, showUI, startCov) analyzes the block by using the sldvoptions object options. The software returns a handle to the newmodel, which contains a copy of the block subsystem.

Examples

collapse all

Analyze the coverage data and collect the missing coverage data.

Analyze the Cruise Control model and simulate a version of that model by using data from test cases from the previous analysis. Compare the model coverage data and collect the coverage missing from the sldvdemo_cruise_control_mod model analysis:

opts = sldvoptions;
% Generate test cases
opts.Mode = 'TestGeneration';
% Specify MCDC coverage
opts.ModelCoverageObjectives = 'MCDC';
% Don't create harness model
opts.SaveHarnessModel = 'off';
% or report
opts.SaveReport = 'off';
openExample('sldv/ExtendTestCasesForModifiedModelExample',...
'supportingFile', 'sldvdemo_cruise_control');
[ status, files ] = sldvrun('sldvdemo_cruise_control', opts);
open_system 'sldvdemo_cruise_control_mod';
[ outData, startCov ] = sldvruntest('sldvdemo_cruise_control_mod',...
    files.DataFile, [], true);
cvhtml('Coverage with the original test suite', startCov);
[ status, covData, files ] = sldvgencov('sldvdemo_cruise_control_mod',...
    opts, false, startCov);

Input Arguments

collapse all

Handle to an atomic subsystem in a Simulink® model.

Handle to a Simulink model.

sldvoptions object that specifies the analysis parameters.

Logical value that indicates where to display messages during analysis:

true to display messages in the log window.
false (default) to display messages in the MATLAB® command window.

cvdata object. The analysis ignores model coverage objectives already satisfied in startCov.

Output Arguments

collapse all

cvdata object containing coverage data for new tests.

A structure whose fields list the file names resulting from the analysis.

DataFile

MAT-file with the raw input data.

HarnessModel

Simulink harness model.

Report

HTML report of the results.

ExtractedModel

Simulink model extracted from the subsystem.

BlockReplacementModel

Simulink model obtained after block replacements.

Logical value that indicates if the analysis collected model coverage.

true for analysis collected model coverage data.
false if analysis does not collect model coverage data.

If the API is invoked with block, then the software returns the handle to the new model in newmodel which contains a copy of the atomic subsystem block.

Version History

Introduced in R2007a