AI Test Generation SOP: Safely Drafting Unit, Regression Tests
A six-step SOP for AI automated test generation: when to use + baseline (coverage/defect escape) -> unit tests from code -> regression tests from issues -> batch boundary/parameterized cases -> test maintenance (stale assertions/redundancy) -> human gate + CI. Each step ships copyable pytest and jest code, plus 5 pitfalls (loose assertions/interdependencies/fake coverage/mock drift/not testing the real path) and 5 FAQ. Iron rule: AI only drafts, human review + CI green before merge.