Welcome! Please see the About page for a little more info on how this works.

0 votes
in test.check by

Problem

This sort of code can OOM:

`
(-> gen/boolean

gen/vector
gen/vector
gen/vector
gen/vector
gen/vector
gen/vector
gen/generate)

`

Proposed Solution

Reduce the {{size}} when generating elements of a collection.

  • Should this apply to {{gen/tuple}}? What about {{gen/vector}} with a fixed size?
    -- I'm currently thinking no and yes, respectively
  • Should we blindly reduce the size, or base it on the number of expected elements (e.g., dividing by the number of expected elements)? Predicting element counts is difficult for the {{distinct}} collection generators.

Alternate Approach

Hypothesis allegedly tracks how much randomness has been consumed as a collection is generated, and forces things to be small after it hits a limit.

A similar approach would be difficult for test.check, but maybe not impossible.

One idea is to have generators return, in addition to the rose tree, a number indicating how many bits of entropy they used (and maybe a separate number indicating the {{minimum}} amount of entropy they could possibly consume).

1 Answer

0 votes
by
Reference: https://clojure.atlassian.net/browse/TCHECK-106 (reported by gfredericks)
...