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

Fuzzers for functions #230

Open
Janiczek opened this issue Jan 10, 2024 · 0 comments
Open

Fuzzers for functions #230

Janiczek opened this issue Jan 10, 2024 · 0 comments

Comments

@Janiczek
Copy link
Collaborator

Janiczek commented Jan 10, 2024

The idea, as far as I understand it, is to generate a list of mappings from a to b, and convert that list to a function.

There are a bunch of functions to change these: map works as usual, to change the b into c, but we can also have coMap (profunctor?) that works on the input instead of on the output: given a z -> a function, it changes a -> b to z -> b.

The simplest generated functions map all values to some default value, and more complicated functions have exceptions from the default (ie. "map 9 to 1, map everything else to 0"). Such functions with exceptions do shrink towards the "no exception" case (a constant function).

Prior art:

A classic poster child example of "hey we can generate functions" in the PBT context is testing that map f (filter p xs) == filter p (map f xs). (This is not true.)

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