Skip to content
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

Parameterized, Property-Based, and Fuzz Testing Capabilities #5

Open
moodmosaic opened this issue Apr 3, 2024 · 1 comment
Open

Comments

@moodmosaic
Copy link
Member

Traditional example-based testing falls short in covering the wide array of input combinations and edge cases:

  • each test executes once, with concrete input values. That is, unit test functions are public and without parameters.

As our ecosystem grow more sophisticated, the testing methods must evolve to identify vulnerabilities and ensure contract robustness:

  • at the very least, each test must be able to run multiple times with randomly generated concrete values (smaller values, à la property-based testing).

(From there, via Clarinet config/flag, you can tell to the underling data generator to be biased, and then you'll have turned your property-based tests to look more like fuzz tests—one of the reasons why foundry uses that terminology as well. 🔢)

To summarize:

type prefix arguments semantics
concrete test no single execution with concrete values (you are here)
property test yes multiple executions with randomly generated concrete values (smaller values)
fuzz test yes multiple executions with randomly generated concrete values (biased)

See also:

@moodmosaic
Copy link
Member Author

This can be added to the list: https://x.com/PatrickAlphaC/status/1624137622510571522.

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

No branches or pull requests

1 participant