Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shrinking #23

Open
jackfirth opened this issue Nov 6, 2015 · 0 comments
Open

Shrinking #23

jackfirth opened this issue Nov 6, 2015 · 0 comments

Comments

@jackfirth
Copy link
Collaborator

When Haskell's QuickCheck finds a failing input to a property, before displaying the failure it will attempt to shrink the input first. For instance a list of numbers that fails a particular property may be shrunk by having some of its elements removed or its elements shrunk. QuickCheck will keep trying to shrink falsifying cases until either 1) it can't shrink an input any further or 2) it runs out of time. This library should attempt to do the same. Possible approaches are:

  1. Require a shrink function when constructing arbitraries. This function should return a lazy stream of shrunken versions of its input (lazy to avoid constructing thousands of shrunken versions of a large input before trying any of them). The "most shrunk" versions should appear first in the stream.

  2. Require a function that when applied to a value, produces a list of shrinking functions for that value. This represents that a value may be shrunk in different ways. This is what Hypothesis does. I'm not so sure about how this would work, but it seems like it may be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant