Generate initial test code for MATLAB class
Interactively create tests for your MATLAB® classes in the Editor or Live Editor. The test file created for a concrete class contains code to exercise the public methods, including the default or explicitly defined constructor, of that class. You can use this file as a starting point for adding your own tests. For more information, see Create Tests for MATLAB Source Code.
Address missing coverage by using justifications
Improve your coverage metrics by using justifications to filter blocks of MATLAB source code covered by methods other than automated testing, for instance, by interactive testing. Justifying missing coverage for a block of code is useful if it is not feasible to satisfy all coverage outcomes for that block in automated tests or if you do not intend for your automated tests to exercise the unsatisfied outcomes. Justifications allow you to focus on parts of source code that can and should be tested through automated tests. For more information, see Justify Missing Coverage for MATLAB Source Code.
Test MATLAB code against previously captured baseline data
Use baseline tests to monitor for regressions in code functionality when defining criteria for the intended code behavior is not straightforward. Manually verify that your code works as expected, and then capture the behavior as a baseline. Baseline tests compare the current behavior against the baseline. As you make changes to the code, verify that the code continues to produce the same output by running baseline tests. For an example, see Create Baseline Tests for MATLAB Code.
You can also run baseline tests in projects by using the MATLAB Test Manager. The test manager enables you to create baseline data, export test data to the workspace, and update the stored baseline data. For more information, see Run Baseline Tests in Projects.
View test results from previous runs in the MATLAB Test Manager
View test results from previous runs in the MATLAB Test Manager. For more information, see Qualify Changes by Comparing Previous Runs Using the MATLAB Test Manager and View Test Results from Previous Runs.
Collect coverage for generated C/C++ code in equivalence tests by using the MATLAB Test Manager
Use the MATLAB Test Manager to collect coverage for generated C/C++ code in static libraries that you execute in SIL and PIL equivalence tests. You can view the coverage results in an HTML report or view a summary of the results in the Generated Code Coverage section of the Code Quality Dashboard. For more information, see Collect Coverage for Generated C/C++ Code in Equivalence Tests.
Create and delete requirement links in MATLAB Test Manager
Use the MATLAB Test Manager to create and delete links from MATLAB tests to requirements. See Create and Delete Links to Requirements and Link Requirements and Tests in Projects.
Open requirement sets in the current project
If you have Requirements Toolbox™, you can open the requirement sets in the current project by using the Code Quality Dashboard. For more information, see Open Requirement Sets in the Current Project.
Generate traceability matrix for requirements and tests in the current project
If you have Requirements Toolbox, you can generate a traceability matrix that contains the requirement sets and MATLAB tests in the current project. For more information, see Generate Traceability Matrix for Requirements and Tests in Current Project.
Generate deployable C++ shared library and test for equivalence
Author equivalence tests that use MATLAB Compiler SDK™ to:
Build deployable C++ shared libraries from MATLAB source code.
Execute deployable C++ shared libraries.
Qualify the result by comparing the execution of the deployable C++ shared libraries to the execution of the MATLAB source code.
For more information, see Generate Deployed Code Artifacts and Test for Equivalence and Choose an Approach for Equivalence Testing Generated C++ Code.
Sort tests in the MATLAB Test Manager
Sort tests in the MATLAB Test Manager by load order or natural sort. For more information, see Sort Column Entries.
Generate starter test class for MATLAB source code from toolstrip in MATLAB Online
From the toolstrip in MATLAB Online™, you can generate a starter test class to exercise your source code. With your source file open, go to the Editor or Live Editor tab and in the Test section, click Generate Test.
Generate code coverage report in Cobertura XML format for generated C++ code in equivalence tests
Create a code coverage report in the Cobertura XML format for generated C++ code in equivalence tests. For more information, see Generate Cobertura Coverage Reports for Generated C/C++ Code in Equivalence Tests.