Testing and Code Verification

Write single tests and test scripts


MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

To convert a MuPAD notebook file to a MATLAB live script file, see convertMuPADNotebook. MATLAB live scripts support most MuPAD functionality, although there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

MuPAD Functions

testargsDecide whether procedure arguments should be tested
prog::checkChecking objects
prog::initLoading objects
prog::tcovReport on test coverage (passed program lines)
prog::testAutomatic comparing of calculation results
prog::testexitClosing tests
prog::testinitInitialize tests

Examples and How To

Write Single Tests

The prog::test function is the basic testing tool in MuPAD.

Write Test Scripts

If you write your code in collaboration with other developers or intend to extend or update it later, you need to test your code more than once.

Code Verification

Even if your code executes without errors, and all your tests run without failures, the code can still have some flaws.


Why Test Your Code

After you debug and optimize your code, you might still need to test it.