View License

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

» Watch video

Highlights from

2.5 | 2 ratings Rate this file 3 Downloads (last 30 days) File Size: 7.42 KB File ID: #7845 Version: 1.0.1



David Legland (view profile)


13 Jun 2005 (Updated )

Unit tests with MATLAB.

| Watch this File

File Information

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.


This file inspired M Unit: A Unit Testing Framework In Matlab.

MATLAB release MATLAB 7 (R14)
MATLAB Search Path
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (3)
11 Dec 2013 Manu MJ

27 Jan 2009 Matthew Davidson

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

31 Mar 2007 Naveen Mishra

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

Comment only
08 Jun 2016 1.0.1

update license

Contact us