4.2The 2,000-Test Suite Nobody Runs
Anti-Pattern: A monolithic test suite where every test runs on every trigger. A 500-test suite takes 45 minutes. Nobody waits. Developers merge without test results. The suite exists but has no influence on quality.
Pattern: Tiered execution — different tests run at different stages, matched to the speed and risk requirements of each trigger.
Tiered Execution Model
| Tier | Trigger | Tests | Target Time |
|---|---|---|---|
| Smoke | Every commit / deploy | Critical paths only (login, checkout, core API) | < 5 min |
| PR | Pull request opened/updated | Changed-area tests + smoke | < 15 min |
| Nightly | Scheduled (overnight) | Full regression suite | < 60 min |
| Specialized | On demand | Performance, accessibility, visual regression | Varies |
Impact-based test selection — Instead of running all tests on a PR, analyze which files changed and run only the tests that cover those areas. This requires either test-to-code mapping or AI-powered prediction based on historical data (which tests tend to fail when specific files change).
Test tagging — Tag tests with @smoke, @regression, @slow, @api to enable selective execution from the command line.
Signal-driven selection — A change or a failure is itself a signal about what to run. From a PR diff, map changed files to the tests that cover their blast radius across layers (API, UI, contract, E2E) — not "run everything," not "run the one test with a matching name." From a failure log, treat a failed test as a pointer to a risk area and widen the net around it (the failing endpoint, its contract tests, negative cases, related state transitions). From a Jira ticket, derive both what to run and what to author, always asking "what existing behavior could this break?"