This is an attempt to build a convenient unit test procedures for MATLAB files, following ideas of JUnit for Java, or CUnit.
Idea is create one test for each user function. This test calls user function, and assert some results. If the result does not correspond to the expected one, an 'assertion' is thrown.
At the end of the test, all wrong assertions are shown, and number of passed and failed tests is shown.
Then, if tests are correctly written, lanching the tests after modifications of user programs allows to check no bugs are added.
A (very) simple example is given in directory munit/demo.
Cita come
David Legland (2026). munit (https://it.mathworks.com/matlabcentral/fileexchange/7845-munit), MATLAB Central File Exchange. Recuperato .
Compatibilità della release di MATLAB
Compatibilità della piattaforma
Windows macOS LinuxCategorie
Tag
Riconoscimenti
Scopri Live Editor
Crea script con codice, output e testo formattato in un unico documento eseguibile.
