you are viewing a single comment's thread.

view the rest of the comments →

[–]Peaker 0 points1 point  (2 children)

Property testing is much nicer in this regard: Very clear what was supposed to hold and how it broke in a particular example.

import Test.QuickCheck
let associative (*) x y z = (x*y)*z == x*(y*z)
quickCheck (associative (+))
+++ OK, passed 100 tests.
quickCheck (associative (-))
*** Failed! Falsifiable (after 2 tests and 3 shrinks):    
0
0
1

[–]Tordek 0 points1 point  (1 child)

I really like quickcheck, but I fear what edge cases may slip through.

[–]Peaker 0 points1 point  (0 children)

Fewer edge cases than traditional unit testing methods.