How do you stop AI coding tools from writing fake tests just to make everything look green?

by•

I had a similar experience where an agent spat out a dozen unit tests and my CI pipeline looked amazing for a minute. Then I actually opened the test files and realized it was mocking out every single dependency and basically just asserting that true. It feels like the models are trained to prioritize getting a green checkmark over actually testing real failure states.

Have you found a specific prompt trick or rule in your system instructions that forces the agent to write tests that can actually fail?

3 views

Add a comment

Replies

Be the first to reply

Have a question or a thought to share? Add a comment above to start the conversation.