-
Notifications
You must be signed in to change notification settings - Fork 269
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
Reconsider certain uses of property testing #54
Comments
No objection here. I find it very difficult to parse those tests for correctness, as is. |
Thoughts on this @pipermerriam ? |
Agreed. Writing all of those tests was largely an experiment and I'd say it's failed as 1) they are very hard to read, and 2) they are effectively a second implementation of the logic (like you said). |
Simplifying them to something like the following might make a lot of sense:
|
pacrob
pushed a commit
to pacrob/eth-abi
that referenced
this issue
Apr 14, 2023
A bunch of little patches
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What was wrong?
Though there is clear value in using property testing for certain kinds of tests (such as end-to-end encoding tests), I've recently had some doubts about some other ways we're using property testing.
For example:
https://github.com/ethereum/eth-abi/blob/master/tests/encoding/test_encoder_properties.py#L327-L395
To a large extent, that property test and others like it seem to be testing second implementations of functionality against the original implementations. This doesn't provide much value since the original implementation could have a flaw which wouldn't be revealed by testing it against a second implementation that uses the same logic.
How can it be fixed?
It seems like we should replace these kinds of property tests with traditional tests that check for correct behavior given specific inputs.
The text was updated successfully, but these errors were encountered: