Search code examples
erlangquickchecktriqproper

?SUCHTHAT vs ?IMPLIES in quickcheck


In Triq, PropEr, Quickcheck in Erlang what is the difference between using a ?SUCHTHAT property and the ?IMPLIES?

From what understand they are both specializations of the values produced by generators.


Solution

  • They are similar:

    • ?SUCHTHAT creates a generator, which additionally ensures that each generated value satisfies a constraint.
    • ?IMPLIES creates a property, which has an additional possible result, namely "skip". You can use it after all values have been generated.