Add using --easy flag for faster reducing in README.md (#4)

* fuzz: add seed feature
fuzz: add easy flag (ease csmith)

* fuzz: remove inline prob flag

* fuzz: fix clipboard error...

* update fuzz

* Add `--skip-build` option

* readme: add using --easy for reduce

* Update fuzzer manual

Co-authored-by: Minseong Jang <minseong.jang@cp.kaist.ac.kr>
This commit is contained in:
AinL
2022-04-12 09:15:20 +09:00
committed by GitHub
parent bd581d09e9
commit d4ef6aefd2
2 changed files with 25 additions and 9 deletions

View File

@@ -60,24 +60,33 @@ RUST_MIN_STACK=33554432 cargo test test_examples_end_to_end # run irgen, opti
We encourage you to do homework using the test-driven development approach (TDD). You randomly
generate test input, and if it fails, then reduce it as much as possible and manually inspect the
reduced test input. For example, for homework 1, do:
reduced test input. For example:
```sh
# randomly generates test inputs and tests them
python3 tests/fuzz.py --print
# Randomly generates simple test inputs and tests them.
# If this goes infinitely, then try without `--easy` option. It will generate more complicated code.
python3 tests/fuzz.py <fuzz-option> --easy
# reduces the failing test input as much as possible
python3 tests/fuzz.py --print --reduce
# Randomly generates test inputs and tests them
python3 tests/fuzz.py <fuzz-option>
# fix your code for the reduced test input
# Reduces the failing test input as much as possible
python3 tests/fuzz.py <fuzz-option> --reduce
# Fix your code for the reduced test input
cat tests/test_reduced.c
```
`<fuzz-option>` can be `--print` or `--irgen`. It shall be the one used in [Run](#run).
For more information on usage, please refer to the [Fuzzer User's Manual](tests/README.md).
### Install
```sh
# Ubuntu 20.04
sudo apt install -y build-essential clang make cmake python3 csmith libcsmith-dev creduce
pip3 install tqdm
```
### Run
@@ -103,7 +112,7 @@ Suppose `tests/test_polished.c` is the buggy input program. Then the following s
program to `tests/test_reduced.c`:
```sh
python3 tests/fuzz.py --reduce <fuzz-option>
python3 tests/fuzz.py <fuzz-option> --reduce
```
`<fuzz-option>` can be `--print` or `--irgen`. It shall be the one used in [Run](#run).
@@ -118,8 +127,6 @@ information, we refer to the [Creduce](https://embed.cs.utah.edu/creduce/) homep
**[NOTICE]** The fuzzer supports Ubuntu 20.04 only. It may work for other platforms, but if it
doesn't, please run the fuzzer in Ubuntu 20.04.
For more information on usage, please refer to the [Fuzzer User's Manual](tests/README.md).
## Running RISC-V Binaries
### RISC-V Documentation