How do you handle unit testing when AI tools write 80% of your feature code?
by•
I’ve been leaning heavily on AI assistants to ship entire features in record time, but my test coverage is lagging behind badly. Whenever I prompt the AI to write unit tests, it generates shallow mocks that pass easily but miss crucial edge cases and boundary conditions. Writing comprehensive tests manually afterwards feels like it defeats the speed advantage of using AI in the first place.
For those shipping production apps with AI coders, what is your exact workflow for generating robust, edge-case-heavy tests without manual rewrites?
13 views
Replies
shallow mocks passed for me too.. what changed it was breaking the code on purpose after the test was written. if i delete the check or flip a condition and the test still goes green, the test is useless and it goes back. a test written before the code, while it's still red, is much harder to fake. are your mocks standing in for the thing you're actually testing?
I gave up on unit tests carrying the weight. I lean on E2E tests that click through the real app like a user, and nothing counts as done until the real screen has been checked. One of my apps has 168 E2E specs. A shallow mock can pass. A real browser hitting the real flow can't fake it.