Skip to content

About

A tutorial and a set of examples for playing with NaNofuzz

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

nanofuzz-examples

A set of buggy example programs for playing with NaNofuzz plus a tutorial that can typically be completed in under eleven minutes. If reading this on GitHub, click Code->Codespaces->Create to immediately get started!

./
  tutorial/            NaNofuzz tutorial
  examples/
    typescript/        TypeScript NaNofuzz examples
    python/            Python NaNofuzz examples
    rust/              Rust NaNofuzz examples
    java/              Java NaNofuzz examples
    oxcaml/            OCaml / OxCaml NaNofuzz examples

Several of the example programs have bugs that may be detected using NaNofuzz' heuristic validator. Other examples (e.g., roman, lcm, identitymatrix, modinv, normd) require human or property validators to identify some of the bugs. Input transformers with assume() and custom input generators are demonstrated in the expression parser examples (examples/typescript/expressionparser.ts, examples/python/expression_parser.py, examples/rust/expression_parser.rs, examples/java/ExpressionParser.java, and examples/oxcaml/expression_parser.ml).

Setup

The Codespace installs the Node.js, Python, Rust, Java, and OCaml dependencies automatically. For a local checkout, install the TypeScript dependencies, create the Python virtual environment, build the Rust crate, compile Java, and build OCaml:

yarn install
python -m venv .venv
cargo build
mvn compile
dune build

On Linux or macOS:

.venv/bin/python -m pip install -r requirements.txt

On Windows:

.venv\Scripts\python.exe -m pip install -r requirements.txt

Running Smoke Tests

  • TypeScript: yarn test
  • Python: PYTHONPATH=. .venv/bin/pytest on Linux or macOS, or .venv\Scripts\pytest.exe on Windows.
  • Rust: cargo test
  • Java: mvn test
  • OCaml / OxCaml: dune runtest

About

A tutorial and a set of examples for playing with NaNofuzz

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages