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

Function aware value generation #7

Closed
Seelengrab opened this issue Jul 10, 2023 · 1 comment
Closed

Function aware value generation #7

Seelengrab opened this issue Jul 10, 2023 · 1 comment
Labels
feature New feature

Comments

@Seelengrab
Copy link
Owner

An integrated shrinker like itype currently produces all possible values of the given type, irrespective of the function the value ultimately ends up in. It would be interesting to see whether we can guide generation of values based on the branches on the generated value, in the function that is ultimately tested.

For example, in functions like this:

function foo(x::Int)
     x < 5 && throw(ArgumentError("Not at least 5!"))
     # other code
end

the input space is clearly delineated into two regions, those Int smaller than 5 and thsoe at least 5. In the general case, these sorts of branch points are especially interesting, in particular when it comes to testing whether the branch point is correct. It would be great if PropCheck.jl provided not only integrated shrinkers, but also integrated generators - or function aware generators, which are biased to generate values close to these branch points.

This is a very out-there idea though, so this issue is just here for tracking the thought, not as an indicator that this is actively being worked on.

@Seelengrab Seelengrab added the feature New feature label Jul 10, 2023
@Seelengrab
Copy link
Owner Author

PropCheck.jl has entered maintenance mode, which means that no new features will be added.

If you're interested in a PBT package providing this capability, consider using Supposition.jl, which is actively adding new features & UX niceties. Please open a feature request with that repository if you're interested in this functionality.

@Seelengrab Seelengrab closed this as not planned Won't fix, can't repro, duplicate, stale Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

No branches or pull requests

1 participant