Property testing for Tasks#73
Open
MarekMracna wants to merge 14 commits into
Open
Conversation
adds proptest strategies for generating various tasks adds a convenience macro for writing async property tests generalizes a unit test to a property test
tests that: - tasks always have at least 2 total shares - the accept threshold is at least 2 - a group threshold is compatible with the protocol type - a signpdf task's data has an expected maximum length - a signpdf task's name has an expected format
some tests need sophisticated pointers and locks on tasks, while others only need to return a temporary dummy
a critical voting task should accept if its last voter accepts and reject if the last voter rejects
This test checks the arguably most complicated algorithm of `meesign_server`. It performs a thorough sanity check based purely on the description in ARCHITECTURE.md.
…gTask` A pure function is better in many aspects, especially testability. This refactor enables generation of RunningTask instances for property testing.
…nstances The instances are constructed from VotingTask instances. Constructing RunningTasks in full generality (further protocol rounds) would require simulating the actual protocol, which is overkill for now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for property testing using the proptest crate. It introduces strategies for generating arbitrary instances of various kinds of Tasks and adds several tests for correctness of the strategies and algorithmically heavy parts of the codebase. Finally, this PR also closes #54 and adds an example property test for such fixes.