lundi 29 juin 2015

Why do you need Arbitraries in scalacheck?

I wonder why Arbitrary is needed because automated property testing requires property definition, like

val prop = forAll(v: T => check that property holds for v)

and value v generator. The user guide says that you can create custom generators for custom types (a generator for trees is exemplified). Yet, it does not explain why do you need arbitraries on top of that.

Secondly, it is curious how does arbitrary[Int] convert argument type into generator. I feel that these are related questions.




Aucun commentaire:

Enregistrer un commentaire