paritytech / paritytech/subxt

use proptest for fuzzing tests

Open
#1,506 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
489
Forks
293
Avg merge
18h 35m
Merged PRs (30d)
3

Description

Instead of using loops to add fuzziness to tests i.e. 0...20, we can use proptest instead.

An example of proptest usage can be found in this PR: https://github.com/paritytech/subxt/pull/1501.

For tests that generate entropy/randomness and are just slow, we can avoid using proptest.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the loop-based fuzzing test in signer/src/ecdsa.rs around the referenced 0...20 range, then review the proptest usage in PR 1501 and the proptest documentation. Replace suitable loop-based fuzzing tests with proptest while leaving tests whose randomness only makes them slow unchanged; the affected tests should still cover the same behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
testing
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.