Alex Rivera | Logout

Unit-testing framework for MATLAB

Asked 2010-10-21T21:52:57.830
23

What are the unit-testing frameworks for MATLAB out there, and how do they compare? How should I choose one for our project? What are their pros and cons?

Edit
Report

2 Answers

11

I think the most popular framework for MATLAB is xUnit Test Framework available on File Exchange. Very flexible and well documented.

Some other unit-testing tools are listed here and here.

Another very recent and interesting File Exchange submission is Doctest. Not exactly unit-testing framework though, it works like doctest in Python. I haven't tried it yet, but looks very promising for simple tests embedded into function's help.

answered 2010-10-21T23:39:51.987
1

mlUnit. As far as I know, the only MATLAB unit test framework that:

Also, mlUnit works on older MATLAB versions, e.g. R2006b and probably older. You define your test cases in test suites. A test suite is a MATLAB function file, a test case is a subfunction in that file.

Use the newest 1.6.x version. The 2.0 beta migrated an older version to MATLAB's classdef for implementation, but has not been maintained since. If you run into problems, there's an issue tracking system, because mlUnit is maintained at sourceforge.net.

answered 2013-03-09T20:42:53.257

Your Answer