Questions tagged [testing-and-verification]

Questions about creating, maintaining, and verifying tests for functions and packages. This includes doing unit tests, creating testing notebooks, running verification tests, generating test reports, and using the MUnit package.

Filter by
Sorted by
Tagged with
4
votes
1answer
55 views

How to test if two plots are the same (say, for unit testing)

I'd like to be able to test if two plots are the same. My use-cases involve plots that in one case might be of one type but in another of another type. Principally, I'm interested in the "calculus-...
0
votes
1answer
36 views

Testing notebook corrupted upon quitting kernel during Get

On Mathematica 12.0 for Windows, I have a package foo.wl, and a testing notebook fooTests.nb. My first test loads the file: <...
1
vote
1answer
46 views

How does one test whether or not an integration has succeeded?

This must be a very simple matter--but how to address it eludes me at the moment. I have a series of integrands--and want to flag whether the symbolic integation has succeeded or not (in order to ...
3
votes
1answer
79 views

How to prove a numerical identity?

Let be a function power function f[s_, r_] := Piecewise[{{s^r, s >= 0}, {0, True}}]; And its convolution ...
2
votes
1answer
132 views

Meson build system + C/C++ LibraryLink, help needed for portability check/fix (Windows &MacOs)

As a proof of concept I have created a github repository that shows how to: use the Meson build system to create a Mathematica package using LibraryLink functions The goal is to provide an easy to ...
0
votes
1answer
47 views

Verifying formulas [closed]

I'm trying to Verify that sin(a + b) = sin(a) cos(b) + sin(b) cos(a) with mathematica, but I don't know how to. I've been given a suggestion to use Simplify, but I don't know where/how. I just ...
0
votes
0answers
42 views

How to use === with condition?

I have two expressions, and they are same when k is positive and x is non-zero real number. Below code gives me ...
1
vote
0answers
31 views

How can I launch GenerateDocument with a template file on multiple kernels in a batch fashion?

I am trying to do automated testing of my MMA package by launching test cases that are generated on-the-fly with GenerateDocument and a template document, and then evaluated with NotebookEvaluate. I ...
4
votes
0answers
53 views

Testing packages against old Mathematica versions

I've made a Mathematica package available, and it's been reported to me that it doesn't work with Mathematica 4. I've guessed at some of the issues, and provided work arounds, but that process is ...
5
votes
0answers
86 views

Problems with Failure in Testing Notebooks

This always fails the test: Failure["General", <|"MessageTemplate" -> "`1`", "MessageParameters" -> {foo}|>] While this passes as expected: ...
1
vote
1answer
70 views

Can the window title be modified?

I would like to modify the window title upon initialisation so that the code base is readily identifiable, e.g. Live, Beta, Development, etc. Apparently some systems use different colours to make ...
5
votes
1answer
59 views

CreateNotebook[“Testing”] writes all TaggingRules to the notebook

Bug introduced in V11.2 or earlier and persisting through V11.3 CASE:4072649 Some of notebook types generate notebooks with TaggingRules for their purposes: <...
0
votes
1answer
84 views

Unexplained (possibly faulty) behaviour of Hypergeometric2F1

this might equally be a question for our friends from Math.StackExchange I wanted to verify with Mathematica the analytical ...
29
votes
4answers
594 views

Best practices for using the Testing Framework

I am looking for best practices and recommended workflows for using the Testing Framework. For example, lets say I am developing a Mathematica package for other users, it is hosted on GitHub and I ...
6
votes
2answers
85 views

Testing Graphics in a Testing Notebook

Testing Notebooks report the result of Plot as a Failure, when in fact it should be a Success. Is there a way to fix this?
4
votes
1answer
101 views

Notification if new output differs from old

I'm developing a package and keep a notebook of test cases to make sure a fix in one function doesn't break anything else. Right now, when I make a change to the package, I run the relevant parts of ...
16
votes
1answer
369 views

Automating Testing of Mathematica Code

I'm getting started with unit testing of Mathematica code and looking for information on fitting this into an automated testing environment. For example with Node.js I write some code and tests and ...
0
votes
1answer
56 views

Extract the x values that make the two functions values equal

I have two functions for the x variable. I want to extract x values that make the functions equal. (1) ...
6
votes
3answers
311 views

Avoiding the suppression of messages by NIntegrate

Consider the following code: test[x_] := If[1 < x < 2, Message[Test::message]; x^2, x]; NIntegrate[test[x], {x, 0, 3}] 5.33333333333334 I.e. it gives me ...
5
votes
1answer
354 views

Mock environment setup for unit testing

I am trying to set up the unit testing environment for mathematica code. The problem I am getting is that I can't find a way to mock the methods that my functions use inside ...
9
votes
1answer
272 views

Unit tests for Graphics or FE boxes

Consider the following expression with bad syntax: Graphics[{foo}] How can I detect the error and retrieve the error message programmatically, so I can check for ...
2
votes
0answers
69 views

Can the bins for the Chi-Square test be chosen manually? [duplicate]

I'm trying to check if a vector of data is well-fitted to the negative binomial distribution, using PearsonChiSquareTest[] function. The problem is that my data are ...
6
votes
2answers
303 views

Write Unit Test with expected Message

Using Workbench, I would like to check if my function does emit a message under certain circumstances. How can I test this using an .mt file? I only know about the ...
1
vote
0answers
76 views

Testing Notebook fails on Datasets

I have some functions that read in a .csv and convert them to a Dataset, and do some processing. I've written tests to validate that the correct transformations occur (so far very simple...like ...
0
votes
1answer
177 views

Can Mathematica be configured to not lazy-evaluate by default? [closed]

I notice that VerificationTest will see False for a function in cell 1 ...
1
vote
0answers
152 views

Check, Quiet and VerificationTest with messages?

I have a VerificationTest that is expected to generate some messages. It runs inside of code that uses Check to ...
3
votes
3answers
188 views

VerificationTest for uncaught `Throw`?

I want to demonstrate that Catch[x_] does not catch things thrown with a tag. Catch[Throw[0, 0]] gives Throw::nocatch: ...
3
votes
1answer
102 views

Workbench TestSuite problem

I am working on an application using Workbench 3.0 and Mathematica 10.4.0. I've written a couple of test files for different parts of my work, and a master file with a test suite: ...
1
vote
0answers
41 views

Possible bug with Testing Notebook & messages x::y where x has an OwnValue

I think this should be considered a bug (or at least an inconvenience) and should be reported: Say you have some code generating the $RecursionLimit::reclim2 ...
7
votes
1answer
177 views

Testing Framework applications in the FrontEnd area

I understand that user interaction with GUI can't be tested automatically but some things can be tested using low-level notebook programming functions. Are there any guidelines or limitations of using ...
8
votes
2answers
163 views

Syntactic Sugar for TestReports

Seems to me that VerificationTests are a bit verbose: ...
5
votes
1answer
577 views

Mathematica 10.X benchmark report for high-end surface pro 4/surface book?

Recently, I am seriously considering purchasing the high-end surface device (with intel i7 and maximal RAM). Mathematica will be one of the main applications. Since it is not a full or traditional ...
6
votes
0answers
106 views

Testing Grids in a Testing Notebook

I have an issue testing functions that generate formatted output. For example: 1) Create a new testing notebook and a new test like this: 2) Now execute the test (it fails as expected) 3) Now click ...
4
votes
0answers
266 views

Debugging Test files generates exception in Workbench 2 and 3

I'm having trouble running the "test file" example given in the video here http://www.wolfram.com/broadcast/screencasts/workbench/WorkbenchTesterDemo/ in "Debug As...". RUNning the test file "test....
3
votes
1answer
166 views

How to access timings of each individual test in a TestReport?

I want to know how long each VerificationTest took to complete in the test report, so see which one was the longest and do some statistics on them: ...
1
vote
1answer
124 views

How to freeze and test a list of programs?

I have a list of problems for my students and I'm trying to use the new v10 feature TestResults like so: ...
1
vote
0answers
119 views

Software Testing (Dynamic, Manipulate, DynamicModule) Interfaces

The main Testing Framework (in both the frontend and Wolfram Workbench) supports unit testing for command-line invocations. Is there a natural way of co-opting this, or perhaps there already exist ...
1
vote
1answer
63 views

MUnit tests for aborted during evaluation

I would like to create unit tests, where the function is expected to generate $Aborted, e.g. because it was given wrong input. However, I don't see a way how to ...
6
votes
2answers
333 views

How do I correctly embed VerificationTests in my packages?

I like to write my tests before I code and write them inline when developing a package, and when loading a package those VerificationTests should run and the load should fail and print a report if ...
10
votes
2answers
145 views

Testing Notebook severe slowdown with newlines

Bug introduced in 10.0 and fixed in 10.1.0 I am having a severe slowdown problem with Mathematica 10 new Testing Notebook feature (File -> New -> Testing Notebook). Please try this simple test: Now ...
7
votes
1answer
255 views

How can I programmatically call MUnit tests in Wolfram Workbench?

I have a collection of .mt test files in Wolfram Workbench. Is there a way to invoke the tests programmatically and then write the results to a text file for ...
1
vote
1answer
92 views

MUnit unit tests for TraditionalForm formatting

I'm a strong proponent of unit tests and as such I'm using the MUnit framework from Wolfram Workbench on a regular basis. Many of the codes I'm working on also use ...
4
votes
1answer
148 views

Converting a testing notebook to a notebook

I build a testing notebook and it got too slow and unreliable with many test cases. I want to have a new (classical) notebook with all the the inputs I have in the testing one. Is there an automatic ...
3
votes
1answer
103 views

How do I set up initialization code for Wolfram Workbench MUnit tests?

Say I have a couple of tests like the following: ...
36
votes
2answers
1k views

How to use the Testing Notebook to test a package without shadowing?

I think an important purpose of the new Testing Notebook in version 10 should be to test user packages (instead to test the builtin functions in the ...
5
votes
0answers
330 views

How can I run MUnit tests outside of Workbench under Linux?

I would like to run MUnit tests from the command line. On Mac OS, I can do this: ...
4
votes
1answer
196 views

Running unit tests while debug session is running in Workbench

Is it possible to run unit test while a debug session is already open in Wolfram Workbench 2.0? A typical use case follows: I have a debug in Workbench session open. I evaluate some cells in a ...
10
votes
2answers
500 views

How can I run MUnit TestSuites outside WorkBench?

I would like to run MUnit tests inside TestSuite constructs from the command line or a notebook interface without loading the Workbench GUI. I tried ...
5
votes
1answer
520 views

MUnit creating a hierarchy of TestSuites

I would like to create a hierarchy of TestSuites. However it appears that it is not possible to call a TestSuite from another <...