No BSD License  

Highlights from
munit

4.0

4.0 | 1 rating Rate this file 2 Downloads (last 30 days) File Size: 7.42 KB File ID: #7845

munit

by David Legland

 

13 Jun 2005 (Updated 14 Jun 2005)

Unit tests with MATLAB.

| Watch this File

File Information
Description

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.

Acknowledgements
This submission has inspired the following:
MUnit: a unit testing framework in Matlab
MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
31 Mar 2007 Naveen Mishra

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

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.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
unit test David Legland 22 Oct 2008 07:50:32
junit David Legland 22 Oct 2008 07:50:32
regression tests David Legland 22 Oct 2008 07:50:32
utilities David Legland 22 Oct 2008 07:50:32
miscellaneous David Legland 22 Oct 2008 07:50:32
unit test Ryan Ollos 23 Sep 2009 16:22:01
xunit Ryan Ollos 23 Sep 2009 16:22:01

Contact us at files@mathworks.com