silversixpence-crypto / dapol

DAPOL+ Proof of Liabilities using Bulletproofs and Sparse Merkle trees
MIT License
8 stars 2 forks source link

Fuzz unit tests #46

Open Stentonian opened 10 months ago

Stentonian commented 10 months ago

There are some unit tests that could use with some fuzzing because they test code that uses a RNG. Here is a non-exhaustive list:

Here are some resources to help:

Stentonian commented 7 months ago

Going to use cargo-fuzz

https://rust-fuzz.github.io/book/cargo-fuzz.html

Stentonian commented 7 months ago

Added a fuzz test here: https://github.com/silversixpence-crypto/dapol/pull/141/commits/e75672be04554c82c09e629ef7f74a27b241e877

Can use the framework to do more fuzz tests. They are rather different to unit tests so should be used sparingly, and we should rather use one of these do test a range of input:

See here for advice on the above 2 libraries: https://blog.logrocket.com/how-to-organize-rust-tests/#use-fuzzing