-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
using MOxUnit to run tests #44
Comments
I might be in a minority here but I tend to use the MATLAB Testing Framework because I think it's the most future-proof option (MOxUnit is based on xUnit that precedes the 'official' tool). |
Definitely in favor of long term solutions too. Will have a look at the matlab testing framework but I am wondering if the cost of switching later will be THAT huge. I think that to be cautious we might want to minimize that later cost (i.e try to not rely on some of the MOxunit functions like |
That might be the most pragmatic option: using MOxunit in its most similarly looking syntax to MATLAB Testing Framework so that we can easily switch later on. They have the same ancestor so they must share a lot of similarities (see e.g. assertEqual). |
Might be worth keeping an eye on that Octave implementation. :-) |
Hi! I'm the author of Testify, one of the Octave implementations-in-progress that gllmflndn linked to. Now that I know there's some actual potential users out there for this, I'll bump up the priority on it. Note that the port of the Matlab Unit Testing framework won't be fully Matlab-compatible, due to language-level limitations of Octave: Octave doesn't support method attributes/annotations, so the Testify version of it will rely on naming conventions or something similar instead for the detection of test methods and properties. |
Thanks @apjanke. As mentioned above, I think it would be great to have an Octave implementation of the Matlab Unit Testing framework - if I remember correctly, this is something we discussed last year with other Octave devs on IRC. I think having the Function-Based Unit Tests would be a good start and perhaps enough here so we wouldn't yet come across the current limitation in Octave to implement Tag Unit Tests with Class-Based Unit Tests. When reaching this limitation, the aim would then be to implement the missing feature in Octave. |
For what it's worth, I plan on implementing Script, Function, and Class-Based Unit Tests all at the same time. The back end (that actually executes the tests and records results) will IMHO be a lot easier to implement using OOP, so may as well go right to Class-Based Unit Tests (to the extent that can be done in Octave) and then provide Function-Based Unit Tests as a convenience wrapper around that layer. |
Greetings, I'm the author of MOxUnit. I'm aware that MOxUnit does not support all testing functionality provided by the Matlab testing framework. For example, currently Out of curiosity, which features do the people in this thread find lacking in MOxUnit? Which concerns are there concerning compatibility, and could these be resolved? |
hey @nno thanks for checking on the thread. @gllmflndn might be able to correct me but I don't think there was any specific feature in mind that MOxUnit is lacking but more a general idea to try to stay close to the "official" tools (and help to bring the Octave version "up to speed"). What would be nice though is to see if/how tests "should" be written to maximize compatibility across frameworks. I suspect this is more a documentation issue though (Note: I have not checked if this already exists in the MOxUnit repo). Does that make sense? |
From a quick browse, it seems that we could minimize the cost of switching between frameworks if we write our tests for functions by:
The main "cost" I can see so far would be of switching the content of the main function for each test. See below for more details. I will open a PR just to test a switch to MOxUnit and make sure that the For functions with MOxUnithttps://github.com/MOxUnit/MOxUnit
For functions for the matlab frameworkhttps://fr.mathworks.com/help/matlab/matlab_prog/write-function-based-unit-tests-.html
|
I will be fine with whatever you decide - my concern is being future-proof and minimising time wasted refactoring unit tests in the future. |
Thanks for the Okidoki. I will try to see how things compatible I can make things for now and hope that future-me won't hate me (too much). 🤞 |
Octave Testify author here again. MOxUnit has the distinct advantage of actually existing and working right now. I'm looking at my calendar for the next quarter, and thinking it's unlikely that Octave Testify will have a working Matlab-compatible Unit Test Framework before, say, March 2021. Even then it'll be an un-battle-tested version 1.0. I don't know who all's using MOxUnit, but it has been around a few years, long enough to have some bugs shaken out. I would recommend that if you want Octave-compatible unit tests for BIDS-MATLAB, you just go with MOxUnit now and not worry about future-proofing. If and when an Octave Unit Test Framework becomes available and you decide to switch to it, porting your tests to it would be an easy mechanical exercise – a bit of drudgery, but no big challenge. |
Another issue about infra aspects:
How about switching to using MOxUnit and MoCov to run our tests and get some idea of our code coverage?
https://github.com/MOxUnit/MOxUnit
https://github.com/marketplace/actions/moxunit-action
The text was updated successfully, but these errors were encountered: