Open dunnock opened 4 years ago
heya, not a bad idea i think. similar to how we are implementing our fuzzer for security testing. the approach: 0) generate initial corpus with proptest 1) derive arbitrary trait for custom types 2) use cargo-fuzz to run the tests.
@the-mog nice, do you have a link to the actual code?
not yet.
Validator Node is stateful distributed system, which complicates testing as we should account for issues:
For more background on why this matters read Error Handling in a Correctness-Critical Rust Project. For more inspiration watch "Testing Distributed Systems w/ Deterministic Simulation" by Will Wilson
The easiest way to implement such approach I saw is in sled's test_tree_fail_points.rs, where test runner is enumerating possible operations and starts system in controllable environment, then with a property testing feeding random inputs sequences optionally mixed with fail points triggers, validates that every new regular operation output is as expected.
This might be a nice approach for testing: