| name | bee:dev-fuzz-testing |
| title | Development cycle fuzz testing (Gate 4) |
| category | development-cycle |
| tier | 1 |
| when_to_use | Use after unit testing (Gate 3) is complete.
MANDATORY for all development tasks - discovers edge cases and crashes.
|
| description | Gate 4 of development cycle - ensures fuzz tests exist with proper seed corpus
to discover edge cases, crashes, and unexpected input handling.
|
| trigger | - After unit testing complete (Gate 3)
- MANDATORY for all development tasks
- Discovers crashes and edge cases via random input generation
|
| NOT_skip_when | - "Unit tests cover edge cases" - Fuzz tests find cases you didn't think of.
- "No time for fuzz testing" - Fuzz tests catch crashes before production.
- "Code is simple" - Simple code can still crash on unexpected input.
|
| sequence | {"after":["bee:dev-unit-testing"],"before":["bee:dev-property-testing"]} |
| related | {"complementary":["bee:dev-cycle","bee:dev-unit-testing","bee:qa-analyst"]} |
| input_schema | {"required":[{"name":"unit_id","type":"string","description":"Task or subtask identifier"},{"name":"implementation_files","type":"array","items":"string","description":"Files from Gate 0 implementation"},{"name":"language","type":"string","enum":["php"],"description":"Programming language (PHP mutation testing with Infection)"}],"optional":[{"name":"gate3_handoff","type":"object","description":"Full handoff from Gate 3 (unit testing)"}]} |
| output_schema | {"format":"markdown","required_sections":[{"name":"Fuzz Testing Summary","pattern":"^## Fuzz Testing Summary","required":true},{"name":"Corpus Report","pattern":"^## Corpus Report","required":true},{"name":"Handoff to Next Gate","pattern":"^## Handoff to Next Gate","required":true}],"metrics":[{"name":"result","type":"enum","values":["PASS","FAIL"]},{"name":"fuzz_functions","type":"integer"},{"name":"corpus_entries","type":"integer"},{"name":"crashes_found","type":"integer"},{"name":"iterations","type":"integer"}]} |
| verification | {"automated":[{"command":"./vendor/bin/infection --dry-run 2>&1 | grep -c 'Mutant'","description":"Infection mutation testing configured","success_pattern":"[1-9]"},{"command":"test -f infection.json5 || test -f infection.json","description":"Infection config exists","success_pattern":"exit 0"}],"manual":["Infection config covers critical source directories","Mutation Score Indicator (MSI) meets threshold","No escaped mutants in critical code paths"]} |
| examples | [{"name":"Mutation testing for parser","input":{"unit_id":"task-001","implementation_files":["app/Services/JsonParserService.php"],"language":"php"},"expected_output":"## Mutation Testing Summary\n**Status:** PASS\n**Mutants Generated:** 24\n**Mutants Killed:** 22\n**MSI (Mutation Score Indicator):** 91.7%\n\n## Mutation Report\n| Source Directory | Mutants | Killed | Escaped | MSI |\n|-----------------|---------|--------|---------|-----|\n| app/Services | 24 | 22 | 2 | 91.7% |\n\n## Handoff to Next Gate\n- Ready for Gate 5 (Property Testing): YES\n"}] |