What's the one test you make your AI write before you trust a fix?

by•

A reply on my last thread changed how I think about vibe-coding: whether to keep prompting depends less on how many tries you've made and more on whether a test exists for that part of the app.

Where a test exists, the AI can keep going, because a regression shows up as a red test instead of a user complaint. Where none exists, every "fixed" is a guess.

The test I now ask for first: log in as two different users and try to read each other's data. It takes seconds to run and catches the quiet permission changes AI makes while fixing something else.

Curious what others do:

  1. Which test do you always ask your AI to write first?

  2. Do you make it show the test failing before the fix, so you know the test actually works?

  3. Non-technical founders: have you found a way to check tests are real without reading the code?

I'll share the prompt I use for the two-user test in the replies.

35 views

Add a comment

Replies

Best

An agent wrote a patch and a passing test. Reverting the fix to watch the test fail left it green. The test wasn't even touching the broken path. Do not accept any fix until the new test fails cleanly against the unpatched code first.

Glad that reply was useful, and the two user test is a great first one. Mine is the boundary test for money: what happens when something fails right across a renewal. In our app credits for a song are put on hold when it starts and given back if it fails. The tests I care about most cover the awkward timing: a song that fails in the same week gets its weekly credits back, but if the weekly refill happened between the hold and the failure, the old week's part is dropped instead of stacked on top of the new allowance. Nobody would find that by tapping around, and it's exactly the kind of line an AI "simplifies" while fixing something nearby.

On your non technical question: ask the AI to name each test as a plain sentence about behaviour, like the ones above. You can't read the code, but you can read the list and spot what's missing.