r/vibecoding • u/Impossible-Suit6078 • May 18 '26
When you finally check the tests your AI agent wrote....😂
I'm vibecoding a mobile app in flutter. The app has a home screen widget. Rather than writing actual tests for the home screen widgets, my AI agent read the file containing the widget's native source code and asserted if it contained specific strings. ðŸ˜ðŸ˜ðŸ˜
During a refactor that changed the way a variable was defined, the tests started failing ðŸ˜ðŸ˜
26
Upvotes
9
u/awmath May 18 '26
Had the same yesterday. I told it to remove a single line. It added a regression test... Checking that the exact line is no longer in the file. Sonnet 4.6
5
u/2thick2fly May 18 '26
What the actual f***. I have never seen anything like that? Who trained that? Is it OpenAI / Anthropic?
10
u/Fair-Spring9113 May 18 '26
bold of you to assume people in this sub can read
2
u/Square-Yam-3772 May 19 '26
AIs like to cut corners if they "think" they can get away with it.
you should add a "propose plan first etc" prompt so it shows you the plan and the diff
I wouldn't just go "write me a test class for X" most of the time it is just stubs
2
u/wordswithoutink May 18 '26
Well, you're vibecoding. What did you expect?
1
u/tken3 May 18 '26
Well at least you now know it can spell correctly
1
u/yuehuang May 19 '26
We need a test for the test.
1
u/ShutUpAndDoTheLift May 20 '26
Have your agent list it's obligations before writing tests