fuzz

Generate and test arbitrary inputs against OCaml encoders and parsers.

46|6|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/aresbit/MateBot --skill fuzz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fuzz
Source: https://github.com/aresbit/MateBot/tree/main/skills/ocaml/fuzz
Command: npx skills add https://github.com/aresbit/MateBot --skill fuzz

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about fuzz

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fuzz-test OCaml parsers and encoders for crash-safety?

To fuzz-test OCaml parsers and encoders, you generate arbitrary inputs and verify roundtrip invariants like decode(encode(x)) == x to ensure parsers never crash on unexpected data. This approach automatically tests boundary conditions and validates state-machine transitions.

What do I need to set up OCaml fuzz testing with Crowbar?

OCaml fuzz testing requires the opam package manager, Dune build system, and the Crowbar and borealis libraries. You create a fuzz directory with a fuzz.ml file linking modules, write per-module fuzz test files, then build and run via a single dune exec target.

Can I test state-machine transitions and edge cases in OCaml protocol implementations?

Yes, you can test state-machine transitions and edge cases in OCaml protocol implementations by generating arbitrary inputs against module functions. This validates boundary conditions and transition logic, ensuring protocol behaviors remain stable when subjected to unexpected sequences.

How do I organize fuzz suites for large OCaml codebases?

Organize fuzz suites for large OCaml codebases by creating one fuzz file per module, such as testing lib/foo.ml from fuzz_foo.ml. Assemble these per-module suites across modules and execute them collectively with a single Dune target.

Why does my OCaml parser crash on unexpected or arbitrary data?

OCaml parsers crash on arbitrary data when they lack proper handling for unexpected inputs. Fuzz testing generates random inputs to check crash-safety, exposing boundary condition failures and roundtrip invariant violations before deployment.