Contenido principal

Collect Decision, Condition, and MC/DC Coverage

Collect decision coverage, condition coverage, and modified condition/decision coverage (MC/DC) for MATLAB® or generated C/C++ code
Since R2023a

Collect information about decision coverage, condition coverage, and modified condition/decision coverage (MC/DC) for your source code when you run MATLAB tests or for generated C/C++ code when you run equivalence tests. View coverage results in reports or at the command line, and use justifications to filter blocks of code not covered by the tests.

For an example of basic code coverage analysis using the MATLAB unit testing framework, see Collect Statement and Function Coverage Metrics for MATLAB Source Code.

Classes

matlabtest.coverage.JustificationJustification for missing code coverage (Since R2024b)
matlabtest.plugins.codecoverage.StandaloneReportFormat for standalone code coverage report (Since R2024a)
matlabtest.coder.plugins.GeneratedCodeCoveragePluginPlugin for code coverage information for generated C/C++ code equivalence tests

Functions

applyFilterApply filters to coverage results (Since R2024b)
resetFilterRemove filters from coverage results (Since R2024b)
generateStandaloneReportGenerate standalone report from coverage results (Since R2024a)
addGeneratedCodeCoverageEnable generated code coverage collection for TestTask instance (Since R2026a)

Topics

Collect Coverage for MATLAB Code

Collect Coverage for Generated Code

Featured Examples