开发者

Unit-testing framework for MATLAB [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
开发者_高级运维

Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.

Closed 8 years ago.

Improve this question

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?


The R2013a release of MATLAB includes a fully featured unit test framework


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.


mUnit does the trick: http://www.mathworks.com/matlabcentral/fileexchange/11306-munit-a-unit-testing-framework-in-matlab

I've been using it for >2 years. I had to do some adaptations, such as printing hyperlinks in matlab command window instead of simple text (To quickly go where the error happened). Nevertheless, it is good enough.


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

  • outputs jUnit XML reports
  • comes with an Ant target to execute MATLAB and your unit tests out of the box
  • with these benefits, lets you easily execute your unit tests in a Continuous Integration system, e.g. Jenkins, and monitor your test results there.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜