Canister fuzzing libraries or approaches

As we’re nearing the release candidate for the 1.0 version of Azle, we are entering a more intense phase of automated testing against the Azle library and canisters written with it.

I’d like to essentially ask the community what the state of the art for fuzzing canisters is. The only library I could find was a basic library for generating random values in Motoko.

Is there any kind of general-purpose fuzzing library for canisters? For example, imagine a library that takes a canister’s candid file and automatically generates fuzz tests for that canisters that can be run for indefinite amounts of time.

Does anything like this exist? What fuzzing was used for stable structures @ielashi?

Sounds like a job for PocketIC. It may have some built in stuff that makes things a bit easier? Or are you want ingress to test against mainnet?

Mostly focused on testing against a local replica, but mainnet shouldn’t matter.

I want to just hand a tool the canister name and have it run automatic fuzz tests against it…does PocketIC do any kind of fuzzing?

It doesn’t fuzz but it speaks native IC and I’d imagine working one of the many js fuzzing libraries would be an interesting and productive exercise.

For stable structures specifically, check out this example. Note that stable structures is a library and not a canister, and so we don’t utilize candid for this type of fuzzing.

1 Like