Differential Testing with Foundry
summary
Claims that the Foundry fuzzer plus the ffi cheat code can verify identical behavior between two implementations by running the same fuzzed inputs and comparing rich execution (emits, reverts, storage). Recommends three concrete patterns: a naive single-test comparator, the cport pattern that wraps one test function for both targets (requires VM rollback workarounds), and a preferred pattern that inherits the original test suite and overrides the target factory. Key details: make fuzzing deterministic with a salt and identical dictionary, trade off excluding dictionary entries versus coverage, and a template repo with example tests is provided.
AI-written summary · about
chapters (6)
- 0:00Introduction
- 3:13Why use differential testing
- 7:10Practical EVM use cases
- 12:34Foundry differential pattern
- 19:12Acknowledgements
- 20:19Q&A
related talks
06mFormal Verification of Foundry Tests
01h 15mMake your programs more reliable with Fuzzing
16mRandomised Testing of the Dafny Compiler
21mModern Testing and Fuzzing in Bitcoin Core
38mTesting with two failure seeking missiles: fuzzing and property based testing
53mThree Colours of Fuzzing: Reflections and Open Challenges
53mFuzz Testing for Fun and Profit
59m.NET Testing Techniques You Didn’t Know You Needed
