Main Content
Collect Decision, Condition, and MC/DC Coverage for MATLAB Code
Collect decision coverage, condition coverage, and modified condition/decision
coverage (MC/DC) for MATLAB® code
Collect information about decision coverage, condition coverage, and modified condition/decision coverage (MC/DC) for your source code when you run tests with MATLAB Test™. 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.Justification | Justification for missing code coverage (Since R2024b) |
matlabtest.plugins.codecoverage.StandaloneReport | Format for standalone code coverage report (Since R2024a) |
matlabtest.coder.plugins.GeneratedCodeCoveragePlugin | Plugin for code coverage information for generated C/C++ code equivalence tests (Since R2023a) |
Functions
applyFilter | Apply filters to coverage results (Since R2024b) |
resetFilter | Remove filters from coverage results (Since R2024b) |
generateStandaloneReport | Generate standalone report from coverage results (Since R2024a) |
Topics
Collect Coverage for MATLAB Code
- Types of Code Coverage for MATLAB Source Code
Use different types of code coverage to analyze your MATLAB source code. - Collect Code Coverage Metrics for MATLAB Source Code
Analyze the coverage of your source code and get metrics for all supported coverage types. - Interactively Collect Code Coverage
Collect and access code coverage metrics by using Test Browser, MATLAB Test Manager, or Code Quality Dashboard. - Justify Missing Coverage for MATLAB Source Code
Create a justification within an interactive code coverage report to filter a block of source code that was not fully exercised by the tests. (Since R2024b)
Collect Coverage for Generated Code
- Types of Coverage for Generated C/C++ Code in Equivalence Tests
Use different types of code coverage analysis for generated C/C++ code when you run equivalence tests in SIL mode. - Collect Coverage for Generated C/C++ Code in Equivalence Tests
Measure the coverage of your generated C/C++ code when you run equivalence tests. - Generate Cobertura Coverage Reports for Generated C/C++ Code in Equivalence Tests
Generate Cobertura XML code coverage reports when you run equivalence tests that execute C/C++ code.