-
Notifications
You must be signed in to change notification settings - Fork 38.7k
test: remove rapidcheck integration and tests #18514
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
Conversation
|
ACK, from talking with @MarcoFalke it seems that his/bluematt's fuzzing work has superseded this |
|
I may be a minority, but I run them on every build multiple times a day. Still meaning to review #14430. |
|
ACK. unit and fuzz tests are sufficient. The tests here are better written as unit tests, in which case they also run on all platforms and all dev machines. |
I looked over them and they are better suited either as unit or fuzz tests. If you plan to go over this pull, you could move and transpile them to the appropriate unit test of fuzz test file. It looks like even travis isn't running the property based test. Unit and fuzz tests are run with sanitizers or valgrind turned on. So instead of wasting effort on an experimental and mostly not even compiled testing solution, we should streamline our effort one two that are already widely supported and run. |
|
My impression was that PBT could find different edge cases and stress the code differently from unit tests (which only cover the cases the programmer thought of) and fuzzing, which looks for crashes from inputs. I understand not wasting time and don't want to obstruct consensus, but it might be worthwhile to leave them for any additional coverage they may provide in the future. |
|
I just can't imagine that property based tests could ever come up with more coverage than our unit or fuzz tests can povide. Let's look at this example: where the key is generated by this: The unit test would look like: |
|
I mean if someone comes along and has a great test case that can only be achieved with property based tests, sure I am happy to keep them along. But this hasn't happened in the last three years, nor will it happen in the next three years. And if it did, we can always reconsider and call |
bafc471 to
9e071b0
Compare
|
Concept ACK: keeping an inactive rapidcheck integration around does not feel meaningful If someone in the future comes up with an example where a rapidcheck test outperforms standard coverage-based fuzzing we can always revert this change.
Is @TheBlueMatt fuzzing Bitcoin Core without sharing his fuzzing harnesses with us? :D |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
ACK 9e071b0 |
|
Property based testing only gets interesting over fuzzing when you get in the realm of state-machine testing. ie. generating a random sequence of actions/api calls and checking them against a model of what you expect the state to be (see https://www.youtube.com/watch?v=zi0rHwfiX1Q). rapidcheck didn't seem like the greatest library either. ACK |
This is one of the strengths of fuzzing. See for example the fuzzer to find the money printing consensus failure #17860 . The utxo set is the state and the maximum money supply is the condition you check. enum class Action : uint8_t {
CREATE_INPUT, //!< Append an input-output pair to the last tx in the current block
CREATE_TX, //!< Append a tx to the list of txs in the current block
CREATE_BLOCK, //!< Append the current block to the active chain
}; |
|
TLDR property based testing is fuzz testing |
|
Yes from the code you linked it looks like we're already doing a form of property based testing using FuzzedDataProvider. Good stuff! |
Summary: ``` Whilst the property tests are interesting, ultimately rapidcheck integration in this repository has not gained much traction. We have a limited number of tests, and they are rarely (if ever) run. ``` Backport of core [[bitcoin/bitcoin#18514 | PR18514]]. Test Plan: Check there is no Cmake issue: ninja all check Return nothing: git grep -i rapidcheck git grep -i property_based Reviewers: #bitcoin_abc, jasonbcox Reviewed By: #bitcoin_abc, jasonbcox Differential Revision: https://reviews.bitcoinabc.org/D7226
Summary: ``` Whilst the property tests are interesting, ultimately rapidcheck integration in this repository has not gained much traction. We have a limited number of tests, and they are rarely (if ever) run. ``` Backport of core [[bitcoin/bitcoin#18514 | PR18514]]. Test Plan: Check there is no Cmake issue: ninja all check Return nothing: git grep -i rapidcheck git grep -i property_based Reviewers: #bitcoin_abc, jasonbcox Reviewed By: #bitcoin_abc, jasonbcox Differential Revision: https://reviews.bitcoinabc.org/D7226
Whilst the property tests are interesting, ultimately rapidcheck integration in this repository has not gained much traction. We have a limited number of tests, and they are rarely (if ever) run. Have discussed this with Chris Stewart.