home/productivity/testing-4

Testing

GPTClaudeDeepSeek··167 copies·updated 2026-07-14
testing-4.prompt
# 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 Structure

when 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