Skip to content

Fuzz and minimize bad test cases for encoder/decoder style programs.

License

Notifications You must be signed in to change notification settings

alexreinking/fuzz-and-minimize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Find bad inputs and minimize test cases

Here's some (updated) code I used back in undergrad to find bugs in an assignment we had to write an encoder / decoder for a popular compression format.

Requires Python 3.

Tests that an input that can be passed through both encoder and decoder phases without corruption (ie. it's an identity function). Generates random inputs from a command-line supplied alphabet.

Use like so:

./random_input.py ./example/bad_encoder.sh ./example/bad_decoder.sh 'ABC' > bad_input
./bisect_input.py ./example/bad_encoder.sh ./example/bad_decoder.sh bad_input > bad_input_min

This is all wrapped up into a bash script:

./find_and_minimize.sh ./example/bad_encoder.sh ./example/bad_decoder.sh 'ABC'
cat bad_input ; echo
cat bad_input_min ; echo

YMMV

Licensed under GPL v3.

About

Fuzz and minimize bad test cases for encoder/decoder style programs.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published