Using AI to Write Tests: What Helps and What I Still Check Manually
Writing tests is the kind of work that often gets put off — not because it’s hard, but because it’s repetitive and time-consuming. AI coding agents turn out to be a great fit for this part, but there are limits.
What helps a lot: generating test cases for clear scenarios — valid input, invalid input, common edge cases like empty strings or empty arrays. AI is also good at generating the setup/teardown boilerplate whose pattern is already obvious from other tests in the codebase.
What I still check manually: whether a test actually tests something that matters, or just covers a line of code without a meaningful assertion. AI sometimes produces tests that pass “green” but wouldn’t actually catch it if the logic broke — the assertion is too loose, or it’s testing an implementation detail that doesn’t matter.
Domain-specific edge cases — things I only know because I understand the business context — are still something I have to think through myself. AI doesn’t know what bug caused problems in production last month, so it won’t automatically write a regression test for that unless I explicitly ask for it.
Reviewing AI-generated tests matters as much as reviewing production code. A wrong test is more dangerous than no test at all — it gives false confidence. So I still read every assertion, not just check that all tests “passed.”
The result: I write tests far faster for the repetitive parts, and I spend the time saved thinking through the scenarios that genuinely need human judgment.