Start: PR-Level Coverage Gates
Add a CI step that analyzes coverage for the files changed in each PR. If new code lacks tests, the check flags it (not blocks — flags). This alone changes behavior: developers start thinking about test coverage before submitting PRs, and the AI provides specific guidance on what’s missing.
Expand: Auto-Generation with Review
Enable AI test generation for flagged gaps. The agent proposes tests as suggestions in the PR. The developer reviews, accepts good ones, rejects bad ones. Over time, the agent learns your testing patterns and produces better results.
Mature: Continuous Maintenance
Add flaky test detection and quarantining. Enable the test-fix-verify loop for refactors. Consider visual regression testing for UI-heavy projects. At this stage, the AI is maintaining the test suite, not just generating individual tests.
Key insight: The testing pipeline matures in the same way as the CI/CD pipeline from Chapter 3: start with observation (coverage analysis), then add suggestions (test generation), then enable automation (test maintenance). Each step builds on the trust established by the previous one.