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

Are there resources to learn about shrinking algorithms? #38

Open
CreatCodeBuild opened this issue Jul 17, 2018 · 3 comments
Open

Are there resources to learn about shrinking algorithms? #38

CreatCodeBuild opened this issue Jul 17, 2018 · 3 comments

Comments

@CreatCodeBuild
Copy link

Property based tests are great tools to assert properties of an API. Though I haven't done it in Go, this package looks useful.

I'm more curious about the implementation and the algorithm. Do you know any references or papers I could read?

@untoldwind
Copy link
Collaborator

There is a blog article summing up the the interna of scalacheck: https://blog.ssanj.net/posts/2017-04-12-how-does-scalacheck-shrinking-work.html

And there are several some material about QuickCheck, though I haven't read those.

@au-phiware
Copy link
Contributor

The tests for Int64Shrinker follow a different pattern to the examples in the linked article; is this intentional? I.e. the tests shrink 10 into 0, 5, -5, 8, -8, 9, -9; whereas I would have expected 5, -5, 3, -3, 2, -2, 1, -1, 0. That is to say that the test, like Zeno's tortoise, continually advance towards the shunk value but never reach it instead of exponentially decaying towards zero.

@au-phiware
Copy link
Contributor

I have come across this article that seems to take a similar approach as gopter (at least in the ordering/direction of the shrinking values): https://deque.blog/2017/02/10/code-your-own-quickcheck-shrink/

Is this the kind of approach that gopter takes?

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

3 participants