| name | bee:dev-property-testing |
| title | Development cycle property-based testing (Gate 5) |
| category | development-cycle |
| tier | 1 |
| when_to_use | Use after fuzz testing (Gate 4) is complete.
MANDATORY for all development tasks - verifies domain invariants always hold.
|
| description | Gate 5 of development cycle - ensures property-based tests exist
to verify domain invariants hold for all randomly generated inputs.
|
| trigger | - After fuzz testing complete (Gate 4)
- MANDATORY for all development tasks
- Verifies domain invariants via Pest datasets with boundary values and random generators
|
| NOT_skip_when | - "Unit tests verify logic" - Property tests verify INVARIANTS across all inputs.
- "No domain invariants" - Every domain has invariants. Find them.
- "Too abstract" - Properties are concrete: "balance never negative", "IDs always unique".
|
| sequence | {"after":["bee:dev-fuzz-testing"],"before":["bee:dev-integration-testing"]} |
| related | {"complementary":["bee:dev-cycle","bee:dev-fuzz-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"}],"optional":[{"name":"domain_invariants","type":"array","items":"string","description":"Domain invariants to verify"},{"name":"gate4_handoff","type":"object","description":"Full handoff from Gate 4 (fuzz testing)"}]} |
| output_schema | {"format":"markdown","required_sections":[{"name":"Property Testing Summary","pattern":"^## Property Testing Summary","required":true},{"name":"Properties Report","pattern":"^## Properties Report","required":true},{"name":"Handoff to Next Gate","pattern":"^## Handoff to Next Gate","required":true}],"metrics":[{"name":"result","type":"enum","values":["PASS","FAIL"]},{"name":"properties_tested","type":"integer"},{"name":"properties_passed","type":"integer"},{"name":"counterexamples_found","type":"integer"},{"name":"iterations","type":"integer"}]} |
| verification | {"automated":[{"command":"grep -rn 'dataset\\|@dataProvider' --include='*Test.php' tests/","description":"Property test datasets/data providers exist","success_pattern":"dataset\\|@dataProvider"},{"command":"grep -rn 'property_' --include='*Test.php' tests/","description":"Property test functions exist","success_pattern":"property_"}],"manual":["Properties follow property_{subject}_{property} naming (Pest) or testProperty{Subject}{Property} (PHPUnit)","At least one property per domain entity","No counterexamples found"]} |
| examples | [{"name":"Property tests for money calculations","input":{"unit_id":"task-001","implementation_files":["app/Domain/Money.php"],"language":"php","domain_invariants":["Amount never negative","Currency always valid"]},"expected_output":"## Property Testing Summary\n**Status:** PASS\n**Properties Tested:** 3\n**Properties Passed:** 3\n**Counterexamples Found:** 0\n\n## Properties Report\n| Property | Subject | Status |\n|----------|---------|--------|\n| property_money_amount_never_negative | Money | PASS |\n| property_money_currency_always_valid | Money | PASS |\n| property_money_addition_commutative | Money | PASS |\n\n## Handoff to Next Gate\n- Ready for Gate 6 (Integration Testing): YES\n"}] |