What problem does it solve?
OCaml fuzz testing helps you verify parsers and encoders by generating random inputs and checking invariants, preventing crashes when faced with unexpected data.
Core Features & Use Cases
- One fuzz file per module: tests lib/foo.ml from fuzz_foo.ml for organized coverage.
- Roundtrip and crash-safety testing: ensure decode(encode(x)) == x and that parsers never crash on arbitrary data.
- State machine and boundary coverage: test transitions and edge cases in protocol implementations.
- Easy organization of fuzz suites for large codebases: assemble suites across modules and run with a single dune target.
Quick Start
Install OCaml tooling (opam, dune) and Crowbar/borealis, create a fuzz/ directory with fuzz.ml that links modules, write fuzz_<module>.ml files that define tests, then build and run with dune exec fuzz/fuzz.exe.