Verify Generated Code and Deployed Code Artifacts
With MATLAB® Test™, you can verify generated C/C++ code and deployed code artifacts by using equivalence tests, which are also referred to as back-to-back tests.
Author equivalence tests that generate C/C++ code by using MATLAB Coder™ and verify that the generated code is functionally equivalent to the MATLAB source code. If you have Embedded Coder®, you can measure the coverage of your generated C/C++ code when you run your equivalence tests.
Alternatively, you can author equivalence tests that generate deployed code artifacts by using MATLAB Compiler SDK™, including Java® and Python® packages and .NET assemblies, and test for equivalence.
Classes
matlabtest.coder.TestCase | Test case for generated C/C++ equivalence tests (Since R2023a) |
matlabtest.coder.MATLABCoderTester | Formal tester for generated C/C++ equivalence tests (Since R2023a) |
matlabtest.compiler.TestCase | Test case for deployed code artifact equivalence tests (Since R2023a) |
matlabtest.coder.plugins.GeneratedCodeCoveragePlugin | Plugin for code coverage information for generated C/C++ code equivalence tests (Since R2023a) |
Functions
Topics
- Generate C/C++ Code and Test for Equivalence
Generate C/C++ code from MATLAB code and verify that the execution of the generated code and MATLAB code are equivalent.
- Equivalence Test C/C++ Code for Multiple Entry-Point Functions and Function Signatures
Generate C/C++ code from multiple entry-point functions and signatures and verify that the execution of the generated code and MATLAB code are equivalent.
- Generate Deployed Code Artifacts and Test for Equivalence
Generate deployed code artifacts with MATLAB Compiler SDK and verify that the execution of the generated artifacts and MATLAB code are equivalent.
- Table of Qualifications for Equivalence Tests
Qualify equivalence tests by using verifications, assumptions, assertions, and fatal assertions.
- 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.