Trust, but recompute: how I check AI-assisted code before it reaches users
A student developer's habit of writing independent checks: why a passing build is not proof, and four small examples from production work.
I am a third-year software engineering student and I work part-time on a few web applications that real businesses use every day. I write most of my code with AI tools next to me, Cursor and Claude. They are fast, and they are often right. The problem is the word often.
Early on I noticed something uncomfortable: AI-assisted code fails in a very polite way. It compiles, the types check, the happy path works, and the explanation sounds confident. If I only read the diff and the summary, I am mostly checking whether the story is convincing. So I changed the question I ask before a release. Not "does this look right?" but "what would I have to recompute, from scratch, to believe this is right?"
Here are four small examples of what that looks like in practice.
1. A checker that does not trust the solver
In a university course project I wrote a vehicle routing solver in C. The first thing I wrote after the solver was a separate checker. It ignores everything the solver reports and recomputes each route's length and each customer visit from the raw input. This sounds paranoid until you see why: a bug that silently drops one customer produces a shorter route, which looks like a better result. Without the checker, my best "improvement" would have been a bug.
2. Testing the race, not the function
At work I built the booking flow for a reservation platform. Two people booking the same hall for the same evening is the one thing that must never succeed twice. Unit tests of the booking function passed, but they never ran two requests at the same time. The fix was to lock the row and re-check the conflict inside the same database transaction, so the losing request gets a clear 409 error. The check that matters is a script that actually fires concurrent requests and counts how many bookings exist afterwards. Today the project has 189 of these small check scripts plus a Playwright browser flow, and they run before every release.
3. Asking someone else to attack it
For a sales dashboard that reads marketplace Excel exports, I asked for an independent review instead of reviewing my own upload code again. The review found that a 1 KB crafted Excel file could make the server try to use about 4 GB of memory. Everything "worked" with normal files; it only broke when someone tried to break it. It is fixed now, and that file is part of the tests. The lesson for me: the person (or tool) who wrote the code is the worst one to imagine how it fails.
4. Let the model read, let code decide
In an order panel, a language model reads customer messages and extracts the order details. But the model never makes the final decision: deterministic code checks every field, matches the address against the carrier's official list, and stops when something is uncertain. Before trusting it, I built a small set of 24 real conversations and measured one thing that matters most: how often the system is wrong but confident. On that set it was zero. That is a small set, so I treat it as a floor, not a guarantee.
What I would tell another student
- A passing build is a claim, not proof. Ask what you would need to recompute to believe it.
- Write the checker before you celebrate the result, and make it independent of the code it checks.
- Test the situation that can actually hurt users (concurrency, hostile input), not only the function.
- Use AI to go faster, and spend part of the saved time on verification. For me that trade has been worth it every time.
I am still learning, and I am sure my checks have gaps I cannot see yet. If you have a habit that caught a bug your tests missed, I would like to hear it in the comments.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article