logoalt Hacker News

kbr- • today at 12:53 PM • 0 replies • view on HN

Define "normal test".

Property test can state general properties about the signature being tested. E.g. let's say you're proving correctness of addition in an abelian group. You can state Associativity, Commutativity, Identity Element (0), Additive Inverse, Closure, Cancellation Property, as properties of the signature, in the Property Testing framework you're using (Haskell: QuickCheck, Python: Hypothesis, and so on). The framework will generate test cases using a specially-crafted random distribution (one crafted to maximize the chance of catching a bug), then if it finds a failing case, it will shrink it, so your counterexample is minimal.

It is a "normal test" except that you use a powerful framework to give you these mechanisms.

It still depends on randomness, so it's still inferior to a theorem, which gives you 100% correctness.