# Is there QuickCheck testing framework variant for Mathematica?

Is there QuickCheck-like testing framework variant for Mathematica?

We could analyse function argument patterns and generating arbitrary values matching patterns. The idea of generating values, testing rewriting rules and validating that the result match the required pattern seem very natural to pattern rewriting system.

• Take a look at VerificationTest and TestReportObject and TestReport. You will have to do some of the work yourself when compared with some other testing frameworks, but there is a lot of capability there. May 21 '20 at 20:19
• thanks @MikeColacino I'm aware of MUnit, but the whole idea of QuickCheck is an automatic test case generation (from types in languages like Haskel or Scala) and property-based testing. In case of Wolfram language we could use automatic generation of test data from patterns. May 22 '20 at 8:22
• Hi @PavelPerikov! I just published this, hope it helps! community.wolfram.com/groups/-/m/t/2309649 Jul 11 at 3:07

I've created a pretty cool package for automated property-based testing called quickcheck.wl, you pass three arguments to the function: the name of you property, the actual property (must be an equation, inequation or anything that yields a boolean value like a logical operator) and some assumptions.

QuickCheck[
"Conjugating a complex flips the imaginary sign",
Conjugate[a] == Re[b] + -1 Im[b] I,
"Assume" -> {a -> \[CapitalTau]ComplexInteger}
];


It will test the property by fuzzing the property symbolically. You can specify many types, currently, there are 18 types..

The function can have a few useful options, such as the exponent range of decimals and integers, and minimum-maximum sizes for lists and strings.

• Wow, that's cool! I will give it a try. Thank you! Jul 12 at 4:40