Skip to main content
Vibe Code Forum

Article: Test before you trust: simple checks for AI-written code

AI-written code often works for the example you tried and fails on the next one. Testing is how you find out before your users do. You don't need to be a developer to do the most valuable part.

Manual testing: be a difficult user

After every feature, spend five minutes trying to break it:

  • Empty: submit forms with nothing filled in.
  • Too much: paste a very long text, an emoji, a name with an apostrophe (O'Brien).
  • Twice: double-click Save. Do you get two copies?
  • Back and refresh: does the page survive the back button and a refresh?
  • Phone: try it at phone width and on a real phone.
  • Slow: in browser developer tools you can slow the network; do buttons show that something is happening?
  • Another user: sign in as a second test account. Can it see the first account's data? It shouldn't.

Write down what failed and give the list to your AI tool, one item at a time.

Automated tests: let the AI write them

Automated tests are small programs that check your code still does what it should. They are worth it once a project has real users, because every new change can quietly break an old feature.

Ask:

Add automated tests for the booking feature: creating a booking, listing only my bookings, and refusing to show another user's booking. Use the testing tool most common for this stack, and tell me the command to run them.

Then:

  • Run the tests yourself and see them pass.
  • Break something on purpose (change a rule) and check a test fails. A test that never fails proves nothing.
  • Ask the AI to run the tests after every change. Agents can do this themselves.

Check what the AI says it did

AI tools sometimes say "done, all tests pass" when they didn't run them, or "fixed" when they changed the test instead of the code. Look at the list of changed files. If a test file was edited to make a failure go away, ask why.

Before you go live

Run through the going live checklist, which includes a final round of these checks.

Read next: When it breaks: a calm debugging routine and Going live checklist: check this before you share the link.

More in Build guides