Search code examples
scalascalatest

What does maxDiscardedFactor do in ScalaTest?


The documentation for PropertyCheckConfiguration is basically empty and in particular it is not documented what the maxDiscardedFactor setting does, and in particular, how it is different from PropertyCheckConfig's maxDiscarded setting (as the latter has been deprecated). Does anyone know?


Solution

  • maxDiscardedFactor in ScalaTest is the same of maxDiscardedRatio of ScalaCheck: it represents the maximum allowed ratio between discarded and passed property evaluations.

    Instead, the deprecated maxDiscarded represents an absolute number of the maximum discarded tests allowed per property.

    According to this ScalaTest issue, maxDiscarded has been deprecated in favor of maxDiscardedFactor, while in the ScalaCheck project the maxDiscarded property has been completely removed (see here).