stacks-network / stacks-test-tools

Repo for testing
MIT License
3 stars 7 forks source link

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

Open moodmosaic opened 3 months ago

moodmosaic commented 3 months ago

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


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

(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 commented 3 months ago

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