I am testing an approximative algorithm (FastDTW) against the optimal solution by calculating the relative error and comparing that to the errors given in the paper [1].
Problem is that the errors can get much larger than the ones given in the paper and without setting the tolerance to "accept all" there is no way that all tests pass.
Is there a way to tell QuickCheck
that I expect only n
of the tests to pass? I see that there is the function cover
. But just wrapping the test in that does not seem to work as expected.
Alternatively I could run the test several times manually and pass if at least n
tests pass, but I hope that this can be achieved through QuickCheck
.
Edit in response to Carsten
I wrapped like this:
actualTest :: [Double] -> [Double] -> Bool
actualTest = ... -- runs dtw and fastDtw, compares errors against goal
coverTest :: Property
coverTest = cover True percentage label actualTest
But I am not sure about the first parameter class
, or the label one. Thinking about it more ... I guess cover
is used to ensure that at least a certain percentage of tests conform to a certain condition.
[1] http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.432.4253&rep=rep1&type=pdf#page=64