Testing
# Test Class Generation Rules
> Instructions for AI agents when generating Apex test classes.
---
## Absolute Rules
| Rule | Enforcement |
|------|------------|
| `SeeAllData=true` | **BANNED** — never use, no exceptions |
| Minimum coverage | **75%** (target **90%+**) |
| Test data | Always use `@TestSetup` or `TestDataFactory` |
| Assertions | Every test must have `System.assert*` with meaningful message |
| Bulk testing | At least one test with **200+ records** |
| Negative paths | At least one test for error/exception scenarios |
---
## Test Class Structurewhen to use it
Community prompt sourced from the open-source GitHub repo rvaghela20/forcekit (MIT). A "Testing" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.
tags
productivitycommunitydeveloper
source
rvaghela20/forcekit · MIT
more in Productivity
Productivity✓ tested
Summarize a doc into decisions & actions
chief of staff who extracts what to DO, not just what was said
Productivity✓ tested
Draft a reply to a hard email
calm, direct communicator who de-escalates without caving
Productivity✓ tested
Turn a brain-dump into a weekly plan
planning coach who protects your focus, not just your calendar