Replies: 1 comment 4 replies
-
And the packages I have seen for WMA too often do not come with unit tests. And when this happens, which is too frequent, it is hard to know how to break down a large package into small units that can be tested in isolation so that we can fix bugs in Mathics3. I have seen this problem in Combinatorica, and KnotTheory. Combinatorica has doctest-like examples from the book that can be run. Generally, there are too few of these cases. Also, the examples contain larger or more complicated situations. What is desired instead are some small, (boring), and simple edge cases that you'd find in a unit test. If a function that exhibits a Mathics3 bug uses other smaller functions, then those generally don't have tests in them.
I have encountered this kind of homegrown code a lot. We have it in the gs (Gries Schneider) code. Another variation appears in Greg Chaitin's Unknowable code. Rubi code has its testing regime as well. To me, this does not reflect well on the Programming Language ecosystem.
Finally, I should mention that one reason we would like to do this in WMA/Mathics3 code is so that the same tests can be run in both environments to make sure we conform. |
Beta Was this translation helpful? Give feedback.
-
I have used WMA for 20 years, and I have never written unit tests, or know colleagues that do that. For me, the main reason is that I didn't write WMA code to distribute it, because to distribute, the user should have WMA. I just test my code locally, doing things like
However, having Mathics, it could make sense to define a test suit like
pytest
to do the tests without making reference to Python. Some of the functions detailed inhttps://reference.wolfram.com/language/tutorial/
(CreateTest
,TestEvaluate
) are not even implemented in the CLI of WMA. What WMA supports is a kind of notebook (a test notebook) which has a kind of cells that allow to define tests and see if they pass. I think that what we would like to have is something that runs in the command line.Beta Was this translation helpful? Give feedback.
All reactions