一键导入
bee-dev-fuzz-testing
Gate 4 of development cycle - ensures fuzz tests exist with proper seed corpus to discover edge cases, crashes, and unexpected input handling.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Gate 4 of development cycle - ensures fuzz tests exist with proper seed corpus to discover edge cases, crashes, and unexpected input handling.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Gate 4 of development cycle - dispatches 6 specialized reviewers (code, business-logic, security, test, nil-safety, consequences) in parallel for comprehensive code review feedback.
Gate 7 of development cycle - ensures chaos tests exist using Toxiproxy to verify graceful degradation under connection loss, latency, and partitions.
Main orchestrator for the 8-gate development cycle system. Loads tasks/subtasks from PM team output and executes through implementation → unit testing → fuzz testing → property testing → integration testing (write) → chaos testing (write) → review → validation gates (Gates 0-7), with state persistence and metrics collection. Gates 4-5 (integration/chaos) write and update test code per unit but only execute tests at end of cycle (deferred execution).
Development cycle feedback system - calculates assertiveness scores, analyzes prompt quality for all agents executed, aggregates cycle metrics, performs root cause analysis on failures, and generates improvement reports to docs/feedbacks/cycle-{date}/.
Gate 1 of the React Native frontend development cycle - ensures all components pass accessibility checks with zero violations: correct accessibilityLabel, accessibilityRole, accessibilityHint, VoiceOver (iOS) and TalkBack (Android) compatibility, and minimum touch target sizes.
Gate 1 of frontend development cycle - ensures all components pass axe-core automated accessibility scans with zero WCAG 2.1 AA violations.
| 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"}] |
Ensure critical parsing and input handling code has mutation tests (via Infection) to discover weaknesses in test suites through code mutation.
Core principle: Mutation testing finds weaknesses in your tests that traditional coverage metrics miss. They're mandatory for all code that handles external input.
<block_condition>
This skill ORCHESTRATES. QA Analyst Agent (fuzz mode) EXECUTES.
| Who | Responsibility |
|---|---|
| This Skill | Gather requirements, dispatch agent, track iterations |
| QA Analyst Agent | Write fuzz tests, generate corpus, run fuzz |
MANDATORY: Load testing-mutation.md standards via WebFetch.
<fetch_required> https://raw.githubusercontent.com/luanrodrigues/ia-frmwrk/master/dev-team/docs/standards/php/testing-mutation.md </fetch_required>
REQUIRED INPUT:
- unit_id: [task/subtask being tested]
- implementation_files: [files from Gate 0]
- language: [php for mutation testing with Infection]
OPTIONAL INPUT:
- gate3_handoff: [full Gate 3 output]
if any REQUIRED input is missing:
→ STOP and report: "Missing required input: [field]"
if language != "php":
→ STOP and report: "Mutation testing via Infection is supported for PHP only"
⛔ Agent Name Resolution: MUST resolve bee: names to runtime-qualified names before dispatch. See shared-patterns/shared-orchestrator-principle.md → "Agent Runtime Resolution".
Task tool:
subagent_type: "bee:qa-analyst"
model: "opus"
prompt: |
**MODE:** MUTATION TESTING (Gate 4)
**Standards:** Load testing-mutation.md
**Input:**
- Unit ID: {unit_id}
- Implementation Files: {implementation_files}
- Language: {language}
**Requirements:**
1. Configure Infection (infection.json5) for source directories
2. Run `./vendor/bin/infection --min-msi=80 --min-covered-msi=90`
3. Analyze escaped mutants in critical code paths
4. Add tests to kill escaped mutants
**Output Sections Required:**
- ## Mutation Testing Summary
- ## Mutation Report
- ## Handoff to Next Gate
Parse agent output:
if "Status: PASS" in output:
→ Gate 4 PASSED
→ Return success with metrics
if "Status: FAIL" in output:
→ Dispatch fix to implementation agent
→ Re-run mutation tests (max 3 iterations)
→ If still failing: ESCALATE to user
## Mutation Testing Summary
**Status:** {PASS|FAIL}
**Mutants Generated:** {count}
**Mutants Killed:** {count}
**MSI:** {percentage}%
## Mutation Report
| Source Directory | Mutants | Killed | Escaped | MSI |
|-----------------|---------|--------|---------|-----|
| {directory} | {count} | {count} | {count} | {percentage}% |
## Handoff to Next Gate
- Ready for Gate 5 (Property Testing): {YES|NO}
- Iterations: {count}
| Rationalization | Why It's WRONG | Required Action |
|---|---|---|
| "Unit tests cover edge cases" | You can't test what you don't think of. Mutation testing finds weaknesses. | Run mutation tests |
| "Code is too simple for mutation testing" | Simple code can still have untested paths. | Run mutation tests |
| "Mutation testing is slow" | Minutes per run. Production bugs from weak tests are slower. | Run mutation tests |
| "We have high coverage anyway" | Coverage != quality. Mutation testing verifies test assertions. | Run mutation tests |