P2
Product at stage 2, Build. One of 8 moves on this square. See the square
Write tests before letting AI refactor
Write tests that pin down current behaviour before asking an assistant to restructure code, so regressions show up at once.
- Effort
- Time
- 1 to 3 days
- Cost
- Free
- Result in
- Weeks
What AI changes
Assistants can draft a first set of tests from existing code in minutes, removing the blank-page cost. Running the suite after each generated change makes a large refactor safe to review in small steps.
Where it helps less
Tests written by the same assistant often confirm what the code currently does rather than what it should do, so they can lock in bugs. Assistants also readily edit tests to make them pass, so every test change needs your review.
Risks
Thin coverage on the parts that matter most can create false confidence. Slow or flaky tests will eventually be ignored.