-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add property-based testing #59
Comments
It's hard to do useful things with coverage without roping in another service. Also, #58. |
@astronouth7303 I suggested coverage tracking because this would allow removing unit tests that were superseded by property-based tests with confidence, but that doesn't need to be done in CI if you don't mind checking by hand when reviewing a PR that removes a unit test. |
As a long term thing, I just check coverage occasionally on my own machine but don't make it a hard block on contribution. Most of that is because I want ppb to be a good entry point for getting into open source, and adding extra tools is. . . not my idea of making that entry point easy. That said, I don't think that has to stay true across all the tools we build and ppb vector, while being build to handle 2d games only (and therefore does some things that math folks might hit me for) it's one of the more advanced pieces of the system. |
This can be closed, as the latest round of PRs should have brought pretty good coverage of the API with property-based tests. |
I think it would make sense, in many cases, to run tests not against hardcoded inputs (and expected outputs), but against random inputs (and properties/equations that should hold).
For instance,
x.angle(x.rotate(alpha)) ≃ alpha
for any vectorx
and anglealpha
.Given that
ppb-vector
is a math library, and written in an effects-free style, it seems to be a great fit for property-based testing, and I can recommend the Hypothesis property-based testing library.It would probably make sense to first add some automation to track line- or path-coverage of the testsuite, ideally ran automatically in CI, but this isn't a strong blocker either.
The text was updated successfully, but these errors were encountered: