3 ms·
Minimisation would go something like this: I have a function takes a list and fails if it has more than two negative numbers in. Quickcheck first finds a fail
by IanCal 10y ago
Minimisation would go something like this:
I have a function takes a list and fails if it has more than two negative numbers in.
Quickcheck first finds a failing test with a list of 200 numbers in. It then tries removing parts of the list to see if it can find a smaller failing example. The final output ends up (hopefully) as [-1,-1,-1]
Much easier to debug than a 200 element input.
I found this very useful when creating a tester for guis because I'd get minimal ui examples where things failed.