Slide 58
Slide 58 text
Thoughts On Fuzzing
In total I found four bugs and made three other improvements, all due to the fuzzer.
Fuzz testing lets you exercise your code in the worst of conditions, before deploying to production. It’s not necessarily easy though. You have to be able to control
network traffic and clocks, simulate crashes, and so on. You’ll generate a lot of log data that is hard to sift through.
It’s hard to balance the probabilities of various fuzz events such that the desired failure scenarios do occur. I know I haven’t yet gotten this right, and it’ll probably require
statistical analysis for proper fine tuning. Other scenarios you might trigger aren’t necessarily failures, but they’re just really inefficient. You need to look at the logs to spot
these.
Debugging is hard when it can take hundreds or thousands of iterations before a bug is triggered. This is where setting conditional breakpoints helps, as does the new
Chrome Inspector support in Node.js v6.3.0.
I was inspired to write a fuzzer for my Raft implementation due to a blog post by Colin Scott, titled Fuzzing Raft for Fun and Publication. In his research paper he also
describes ways of minimising fuzzer logs in order to find the shortest number of steps required to produce an error. I didn’t quite go that far but it’s surely interesting.
Blog post: http://colin-scott.github.io/blog/2015/10/07/fuzzing-raft-for-fun-and-profit/
Photo by Jordan Whitt: https://unsplash.com/photos/EerxztHCjM8