Start a project

AI writes the code faster. Who checks that it works?

4 min read

AI coding tools produce features in minutes, but the code can be confidently wrong. What goes wrong with AI-written code, and how to test it properly.

Close-up of Python source code on a computer screen

A founder can now describe an app to an AI tool and have something running by the afternoon. Developers produce in an hour what used to take a day. That is a real change, and a good one.

It also creates a new problem. The speed at which code is written has gone up enormously. The speed at which a person can check it has not.

What AI-written code gets wrong

AI tools are very good at the common case. Ask for a sign-up form and you get one that works when you fill it in correctly. The trouble is in what was not asked for.

  • The unhappy path. What happens when the email is already registered, the connection drops mid-request, or the user presses Submit twice? If the prompt did not mention it, it is often not handled.
  • Permissions. The page that shows "my orders" works. Whether it stops you from seeing someone else's orders by changing a number in the address is a separate question, and one that is easy to miss.
  • Boundaries. The empty list, the very long name, the zero quantity, the date in another time zone, the 10,000th row.
  • Things that look right. The total is displayed. Whether it is the correct total after a discount and tax needs someone to do the sum.
  • Consistency. Each piece was generated separately, so the same rule may be implemented three slightly different ways in three places.

None of this means AI code is bad. A tired human developer makes the same mistakes. The difference is volume: there is now far more code, written faster, and much of it has been read by nobody.

Why "it runs" is not the same as "it works"

Code that starts without errors has passed the lowest possible bar. It tells you the program does something. It does not tell you the program does the right thing for a real customer on a real phone.

AI tools add a particular trap here. Ask an AI to write the feature and then ask the same AI to write tests for it, and the tests tend to confirm what the code does, not what it should do. If the code calculates the total wrongly, the generated test may happily check for the wrong total. Everything passes, and the bug ships.

How to test AI-written software

1. Test the behaviour, not the code

Do not start from what the code does. Start from what the product is supposed to do, written in plain language: "a customer with a 10% coupon pays 10% less". Then check the running product against that. This is the step that catches the confidently wrong total.

2. Have a person use it

A person on a real device finds what no generated test looks for: the button hidden behind the keyboard, the error message that makes no sense, the step that is simply confusing. For a product built quickly with AI, one careful manual pass usually finds a surprising amount.

3. Try to break it on purpose

Wrong input, empty input, double clicks, the Back button, two tabs at once, a slow connection, signing out halfway. AI-generated code is weakest exactly where nobody gave an example.

4. Check permissions deliberately

Sign in as one user and try to reach another user's data. Try the admin pages while signed out. This is the class of bug with the worst consequences, and it never shows up when you test only your own account.

5. Automate the journeys that must not break

Once the main journeys work, put automated checks on them, so the next round of AI-generated changes cannot quietly break them. This matters more with AI, because large changes arrive often and touch many files at once.

6. Keep a person in the loop for AI-written tests

AI can also help write and repair tests, and it saves real time. But every generated test needs a person to confirm it checks the right thing. A test that always passes is worse than no test, because it gives false comfort.

The honest position

AI has made building software cheaper. It has not made knowing whether the software works any cheaper. If anything, it has made that question more important, because so much more is being built and so much less of it is being read.

Teams that do well with AI tools treat them as a fast junior developer: productive, tireless, and in need of review.

If you have a product built quickly and want to know what state it is really in, a manual pass is the fastest way to find out: see website testing and mobile app testing. For keeping it stable as it changes, see Playwright automation and how we use AI agents under review in AI test automation.

Chat with us