Create and Run MATLAB Tests
MATLAB® Test™ extends the capabilities of the MATLAB unit testing framework. For example, you can:
Automatically create test classes to exercise MATLAB source code.
Run test suites based on file dependencies and requirement links.
Run tests in projects by using the MATLAB Test Manager app.
For more information on how MATLAB Test extends the functionality provided by MATLAB apps, classes, and functions, see Extend MATLAB Unit Testing Framework with MATLAB Test.
Apps
MATLAB Test Manager | Manage MATLAB tests and results for projects (Since R2023a) |
Classes
matlabtest.parameters.BaselineParameter | Baseline parameter (Since R2024b) |
matlabtest.baselines.MATFileBaseline | Representation of baseline data stored in MAT file (Since R2024b) |
matlabtest.constraints.EqualsBaseline | Test if value is equal to baseline data (Since R2024b) |
matlabtest.selectors.HasBaseline | Select TestSuite array elements by baseline-specific
parameterization (Since R2024b) |
matlabtest.selectors.DependsOn | Select TestSuite array elements by source code
dependency (Since R2023a) |
Functions
matlabtest.parameters.matfileBaseline | Define data in MAT file as baseline data (Since R2024b) |
verifyEqualsBaseline | Verify value is equal to baseline data (Since R2024b) |
matlab.unittest.TestSuite.fromRequirements | Create test suite from requirements (Since R2023a) |
Topics
- Create Tests for MATLAB Source Code
Generate a starter test class that contains code to exercise your script, function, or class. Use the generated code as a starting point for adding more tests. (Since R2024a)
- Create Baseline Tests for MATLAB Code
Verify that a MATLAB function continues to produce the same outputs by creating and running a baseline test. (Since R2024b)
- Run MATLAB Tests
Run MATLAB tests programmatically or by using the MATLAB Editor, Test Browser, or MATLAB Test Manager.
- Manage Tests and Results by Using the MATLAB Test Manager
Manage tests and test results for projects by using the MATLAB Test Manager.