jonpurvis/fuzz
Fuzz is a Laravel package for fuzz testing your application. It sends randomized requests and payloads to your routes, helping uncover unhandled exceptions and 500 errors before they reach production.
Architecture fit. jonpurvis/fuzz is a dev-only PestPHP plugin (type: pest-plugin) that adds coverage-guided fuzz testing to an existing Pest suite. Architecturally it sits alongside Pest rather than replacing anything: it consumes a callable + a set of parameter definitions, mutates inputs, and uses code coverage as the fitness signal to drive toward unexplored branches. For our stack this fits cleanly where we already have Pest as the test runner and a coverage driver (pcov preferable for speed, Xdebug acceptable) available in CI.
The fit is best for deterministic, side-effect-light units: validation rules, DTO/casts, parsers, money/date math, state machines, SDK serializers. It is a poor fit for test cases that boot the full Laravel kernel per iteration, touch the database, or depend on HTTP/auth/session state — fuzzing multiplies per-iteration cost, and Laravel's booted-container singletons create state bleed between mutations that produces false positives and non-reproducible failures.
Integration feasibility. Integration is nominally trivial: composer require --dev jonpurvis/fuzz, plugin auto-discovery, write fuzz tests. The real feasibility question is maturity. The package is at v1.1.0, ~20 stars, single maintainer, and the only release note we have is "Skeleton Changes" — meaning the public documentation surface is thin relative to what a TPM needs to sign off: supported Pest majors, required coverage driver, seed/replay semantics, timeout controls, and parallel-safety are all unverified. Treat the integration as a spike with exit criteria, not a committed adoption.
Technical risk.
Key questions to answer in the spike.
--seed flag?--parallel and with Laravel's booted app?Stack fit. Additive and non-invasive: dev dependency only, no production footprint, no runtime contract, no schema or API change. It slots into the existing tests/ tree and inherits Pest's tooling. The gating consideration is where it runs — a dedicated suite/directory (tests/Fuzz or a @group fuzz) excluded from the default composer test and PR pipeline, executed nightly or on a schedule.
Migration path. There is nothing to migrate. The only "migration" is organizational: agreeing that fuzz targets live outside the PR-blocking test run and that findings enter the normal bug backlog with a reproduced, minimized input attached. If we later abandon the package, deletion is a one-line composer change plus removing the test directory — a strong argument for trying it.
Compatibility checklist before adoption.
composer.json and commit the lockfile; it is pre-2.0 and API churn is plausible.Sequencing.
composer fuzz script, publish the corpus/seeds artifact between CI runs.Maintenance. Low day-to-day cost while pinned, but the dependency itself is a maintenance liability: single maintainer, ~20 stars, pre-2.0, and future Pest releases may break it before upstream catches up. Budget for an internal owner who can patch/fork. Track releases; the recent v1.1.0 suggests activity, which is a positive signal but not yet a track record.
Support. GitHub issues only — no SLA, no vendor, no security advisory process beyond MIT's default. Fine for a non-blocking nightly quality aid; unacceptable as a release gate. If we make it release-blocking, we must accept that we are effectively the support organization.
Scaling. Fuzzing is CPU-bound and coverage-instrumented runs are slow; scaling means sharding by target across CI workers with per-shard time budgets, not simply increasing iterations. Cost grows with corpus size and target count, so cap both. Keep the seed corpus in a cached artifact/committed directory so each night resumes exploration rather than restarting from zero — otherwise results regress toward random testing. Do not run it on developer machines by default; it competes with the inner loop.
Failure modes to design around.
Ramp-up. The tooling installs in minutes; the discipline does not. Fuzz testing is unfamiliar to most Laravel teams — engineers need to learn target selection (pure, deterministic, no I/O), how to read a coverage-guided report, how to triage and minimize a crash, and why a "flaky" nightly failure is usually a real edge case. Estimate one engineer-day to spike plus roughly two to three engineer-days of learning spread across the team during the pilot, and a standing ~1–2 hours/week of triage once it is producing findings. If the team cannot absorb that, the correct decision is to defer adoption rather than install it and let the nightly job go red and ignored.
Recommendation. Adopt as a pilot, dev-only, nightly, non-blocking quality aid against pure-function targets, pinned to an exact version, with an explicit exit criterion (finds ≥1 real defect we lacked a test for, reproducibly). Do not adopt as a release gate, and do not extend it to integration- or HTTP-level targets in this phase. Re-evaluate upstream maturity at the next Pest major release.
How can I help you explore Laravel packages today?