File Exchange

image thumbnail


version 1.0.1 (7.42 KB) by

Unit tests with MATLAB.



View License

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.

Comments and Ratings (3)

Manu MJ

Simple to use, which is a virtue given the more complex offerings out there, but lacks setup and teardown facilities.

Naveen Mishra

Note that with MATLAB R2007a, there is a builtin assert function.



update license

MATLAB Release
MATLAB 7 (R14)

Inspired: MUnit: a unit testing framework in Matlab

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today