Skip to content

Property testing for Tasks#73

Open
MarekMracna wants to merge 14 commits into
crocs-muni:develfrom
MarekMracna:fix-post-threshold-decisions
Open

Property testing for Tasks#73
MarekMracna wants to merge 14 commits into
crocs-muni:develfrom
MarekMracna:fix-post-threshold-decisions

Conversation

@MarekMracna

Copy link
Copy Markdown
Collaborator

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.

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.
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

Successfully merging this pull request may close these issues.

1 participant