Random Fuzzy Thoughts
tigerbeetle.com
tigerbeetle.com
It's because we build lousy software with lossy interfaces and strangely-undefined interactions that these tools exist. They're used when someone says "we'll never really know what's going on there, just throw some tooling at it and maybe we'll get lucky!"
One would hope we would try to make software more like the former than the latter.
Fuzzing, property testing and mutation testing are attempts to get an inherently complex system under control. Typically, these approaches are also cheaper than formal proofs to develop which is really important because engineering isn’t just building the thing. It’s evolving the thing, maintaining it, and the cost of all of this in manpower is absolutely critical to consider. Think Space Shuttle design where you have to get everything right up front vs SpaceX’s fail fast approach.
Only in the same sense where if people just wrote perfect bug free code then we would not have to test. Tragically, people are not omniscient or perfect programmers, so tools remain useful.
I think that sets an unnecessarily low upper bound on the complexity of the system.
Did Feynman completely understood the Space Shuttle when investigating the Challenger disaster? Perhaps, but we can't always rely on having a Nobel laureate at hand.
It's slow to run, and needs a long configuration then calibration time until you don't find false positives anymore.
Also, many bugs found by fuzzing are in the "it's ok to have them" range.
10Mo URL crashes my Python interpreter? I'm ok with that.
Not to say fuzzing is not useful, but it's not cheap, and the benefits really shines for mature software.
Either you're wrong about the "false" part or you're testing the wrong entry point.
Fuzzing has a long warmup time but probably the lowest false positive rate of any testing technique - if it crashes you're wrong about some invariant, even if that's only "I need to fuzz parseX, not decodeX".
A thing is only a bug if it's a problem for use case your users will have an issue with.
The first couple of runs everything breaks, then code is added to NOT catastrophically fail, then you are pretty good.
(or move into lots of false failures)
Sort of like -Werror or linting/static analysis type tools, or code coverage, or similar...
This Go example[1] demonstrates how fuzzing helps precisely define what a valid string is for the purposes of reversing it.
The author mentions correctly that for composite generated types, the shrinking behavior can compose too. So, a list of integers might shrink both integer values, to a lower bound, and the list size to have one less element, so you wouldn't need to implement a custom list of integers shrinking behavior. You can just compose the fuzzing generators.
There is an excellent book by Fred Herbert about property testing. It's Erlang based but the general concept applies to other frameworks: https://propertesting.com/book_shrinking.html
It’s basically a wrapper around afl.rs and the honggfuzz rust library, and runs both fuzzers in parallel.