random testing (fuzzing)
inf monkey theorem
a monkey hitting keys at random on a typewriter keyboard for an infinite amount of time will almost surely type a given text
first popular fuzzing study
Barton Miller, U of Wisconsin, command-line fuzzer testing Unix programs
security bug: gets() in C and how to fix
popular fuzz testing tool for mobile app
- usually used to generate a sequence of events with delay
monkey tool: generate gesture: slide unlock
down(x1, y1)
move(x2, y2)
up(x2, y2)
concurrency delay in practice
introduce a random delay in each thread, fuzz the thread scheduler
advantages of cuzz
bug depth
dead lock
neither thread can make any progress because the one of the thread is holding the lock
cuzz probability of finding the bug
1/(n*(k^(d-1)), worst case
n bugs, k steps, d depth
1/n for choosing the correct first thread
1/k for switching thread at the correct step
1/(k^(d-1)) for choosing the correct d-1 statements
why measured != worst-case
cuzz vs stress testing
cuzz is much better:
pros of random testings
cons of random testings
should fuzzing replace systematic, formal testing?
No
recommended applications for fuzzing
testing security, mobile apps, and concurrency
not recommended applications for fuzzing
- system with multiple layers (compilers)
thread schedule is decided by