hedgehogqa / hedgehogqa/fsharp-hedgehog

When shrinking, try zero value first as a shortcut

Open
#223 12 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
F#
Stars
284
Forks
31
PR merge metrics
No merged PRs in 30d

Description

A test may have many generated values. These are potentially large and require many shrinks to get to the "simplest" value (e.g. `0`). Often, a test failure does not depend on many of the generated values. Still, I often experience these not being shrinked fully to the "simplest" value, because there's a lot to shrink and Hedgehog gives up shrinking after a while.

This could be alleviated if Hedgehog, upon shrinking, first tested the "simplest" value of each generated parameter. If the test still fails, do this for the next, etc. If the test passes, revert and try the next parameter. After having "shortcutted" all possible parameters like this, which takes only as many shrinks as there are generated parameters, proceed with shrinking as normal. (This would also have the benefit of "saving" most of the shrinking capacity to the generated values that actually need proper shrinking.)

Am I making myself understood, or is my explanation hard to follow?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.