Write the test class for this Apex
Not coverage — assertions. This prompt produces tests that would actually catch the bug you will write next month.
The platform's language: classes, triggers, tests and limits.
Not coverage — assertions. This prompt produces tests that would actually catch the bug you will write next month.
One class, builder-style defaults, no framework — the 80% of a test factory most orgs actually need.
The five-method handler shape that survives 200-record batches — collect, query once, map, loop, DML once.
The primary source. Learn to read it before any course — including mine.
Dan Appleman's book is still the deepest treatment of Apex patterns in print — read it after your first triggers, not before.
Builder-pattern test data factory for Apex: sensible defaults, relationship wiring, bulk builders — tests that read like specifications.
Minimal trigger framework for Salesforce: one trigger per object, handler interface, per-object bypass, recursion guard. No dependencies.
Fifteen years of the same five mistakes: queries in loops, tests without assertions, triggers with opinions, hardcoded Ids, and empty catch blocks.