-
Notifications
You must be signed in to change notification settings - Fork 122
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
Better document/fix shrinking API #218
Comments
@sir4ur0n Thanks for your interest! I will look into these requested changes. |
@sir4ur0n For 1), you're right -- there's no particular reason to try larger shrinks before smaller ones.
These three sound like each might be valuable independent of the others. What do you think about having separate GH issues for each? |
I propose we address 1) through #219
Then we can close this issue :) |
Agreed. Closing this one. Thanks! |
Hi,
I have written a library of generators for Vavr, and I'm now addressing the shrinking part.
The shrinking API is weird and not enough documented. Here's a list of proposals:
Why try bigger values before smaller values?
See QuickCheck documentation on shrinking: it tries smaller values before bigger values, which makes more sense (don't bother testing a huge list of N-1 elements if an empty list already blows up).
Support a lazy structure:
doShrink
must return ajava.util.List
which has only strict implementations in the JDK AFAIK. Building a list of shrinks may be CPU-heavy, and if the first value doesn't pass, then we discard everything and start shrinking again from the slightly smallest value.If we could return a lazy structure (e.g. a Stream), this would significantly improve the shrinking process.
Provide an easy way to log/understand what happens during shrinking, much like QuickCheck provides a verbose mode which details every step (passed, failed, shrunk, etc.).
If it already exists, providing documentation to detail this would be nice 😄
Let me know if you want me to open several issues.
The text was updated successfully, but these errors were encountered: