← The AI Builder Stack

Testing, Debugging & Quality Control

The AI writes the code. You still have to catch what it gets wrong.

00 — Why This Layer Exists

Here's the trap: AI-generated software almost always looks finished. The button is styled, the page loads, the demo works. "It looks right" feels like proof, but it isn't — it's just the first thing you can see. The bugs that actually hurt you are the ones hiding one click deeper: the form that silently fails to save on mobile, the checkout that breaks when a user has two items instead of one, the delete button that deletes the wrong row.

You cannot read most of the code your AI tool writes, and that's fine — that was never the plan for you. Your job in this layer isn't to become a programmer. It's to become a reliable verifier: someone who has a repeatable way to check that a change actually did what it was supposed to, without understanding the code that makes it happen. That skill — verification without comprehension — is the entire craft of this layer.

01 — What "Verifying" Actually Means When You Can't Read the Code

Since you can't audit the code, you audit the behavior. Every change an AI agent makes should be checked against three questions, in this order:

  1. Did the thing I asked for actually happen? Click through the specific feature you requested. Don't take the AI's "Done! I've implemented X" summary at face value — that message describes what it attempted, not what it verified.
  2. Did anything else break? This is the part beginners skip. AI agents frequently touch more files than the task required, and a fix in one place can quietly snap something in another. This is what "regression" means — a feature that used to work, no longer does, because of an unrelated change.
  3. Does it survive a slightly rude user? Type nothing into a required field. Refresh mid-action. Click submit twice fast. Non-technical testing doesn't need to be clever, just slightly adversarial.

This is genuinely how professional QA thinks about AI-written code in 2026 as well — treat AI output as a draft, not a finished product, and check it against real behavior rather than trusting the summary the model gives you.

02 — Reading an Error Message Without Panicking

A red wall of text feels like a crisis. It isn't. An error message is the app trying to tell you exactly where it got confused — it's the most useful thing that can happen when something breaks, because a silent failure gives you nothing to work with at all.

Here's the beginner-safe way to read one:

  • Ignore most of it. Look for the first line in plain English (not file paths or numbers) and the last few lines, which usually name the actual failure point.
  • Don't try to fix it yourself. Copy the whole thing — the full error text, not a paraphrase — and hand it to your AI agent.
  • Give the AI the moment, not just the message. What were you doing right before it happened? "I clicked Save on the profile page" is more useful than the error alone.

A workflow worth adopting from AI-debugging practice: ask the AI to explain the error in plain English before asking for a fix, ask it which part of the app is actually the likely trigger, and once it proposes a fix, explicitly ask "what could go wrong with this fix — any edge cases where it fails?" That last question catches a huge share of fixes that patch the symptom but not the cause.

What's actually useful to paste back:

Paste this Skip this
The full error text/stack trace, unedited Your own guess at what caused it
What you clicked or typed right before A screenshot with no text (text is searchable/copyable, images aren't)
Whether it happens every time or sometimes Apologies or hedging — just the facts
The URL or screen you were on Unrelated code you think might be involved

03 — The Manual Regression Checklist Habit

"Regression" is just the word for "something that used to work, and now doesn't." The single highest-leverage QA habit you can build as a non-coder is a short, boring checklist you run after every AI-made change — not just the feature you touched, but the app's core paths.

For a small app, this is usually 5–10 items, takes under five minutes, and never changes:

  1. Load the homepage — does it load at all, no blank screen?
  2. Log in / log out (if applicable)
  3. The one or two core actions your product exists to do (post something, buy something, save something)
  4. Submit a form with something missing or wrong in it — does it fail gracefully, or crash?
  5. Navigate between the 3–4 main pages
  6. Reload the page mid-flow — does state survive or silently vanish?
  7. Check it on mobile width, not just your laptop screen

Run this list after every meaningful AI change, before you move to the next task. Keep it as a plain checklist (a note, a doc, a pinned message to yourself) — it doesn't need a tool. The discipline is the point: catching a break five minutes after it happened, while you still remember exactly what changed, is dramatically cheaper than catching it three features later when you have no idea which change caused it.

04 — Letting the AI Write Automated Tests (and What "Coverage" Means)

You will never write a test yourself in this role — but you should routinely ask the AI agent to write them, because tests are code that checks other code automatically, every time, without you clicking through the checklist by hand.

You don't need to read the test code. You need to know what to ask for and what the result means:

  • "Write tests for the core user flows" — signup, checkout, the main action — not for every tiny function.
  • "What's not covered by tests yet?" — a good agent can tell you plainly which parts of the app have no automated checks at all.
  • "Run the tests before you tell me this is done" — make this a standing instruction, not a one-off ask.

Test coverage, in beginner terms, is simply how much of the app's behavior has an automatic check on it — not a code metric to chase for its own sake. A common misunderstanding is treating a high coverage percentage as the goal. It isn't: a smaller set of tests that genuinely exercises how people use the product beats a large set of shallow tests that technically "touch" a lot of code but check nothing meaningful. What you're really asking for is confidence on the paths that would actually hurt the business if they broke — not a number.

Your role is to ask the question, not compute the answer: "Do the parts of this app that matter most have tests? What happens if I ask a new user to try the signup flow — is that covered?"

05 — Browser DevTools: Your Beginner X-Ray

Every browser has built-in developer tools (right-click anywhere → Inspect, or F12) built for engineers, but two beginner-usable tabs are enough to catch most visibly broken UI:

Console tab. This is a running log of errors the page is having, in red. You don't need to understand the message — its presence is the signal. If you click a button and nothing happens, but you see a fresh red line appear in the console, that's your app's failure said out loud instead of a mystery. Copy the red text and hand it to your AI agent exactly as in Section 02.

Network tab. This shows every request your app makes to load data — images, styles, calls to the backend — as a table of rows. Reload the page with this tab open and scan for two things: rows marked in red (something failed to load — a broken image, a missing style file, a failed data fetch) and a Status column showing anything other than a number starting with 2 (like 404 "not found" or 500 "server error"). If the page looks broken — no styling, missing content, a spinner that never stops — the Network tab usually tells you which specific thing failed to arrive.

You're not debugging here — you're gathering evidence. "The console shows a red error mentioning 'undefined'" or "the Network tab shows a 404 on something called /api/profile" is exactly the kind of concrete detail that turns a vague "it's broken" into something your AI agent can act on immediately.

06 — How to Actually Do This: A Triage Process for When Something Breaks

When you hit a break, don't freeform-panic-prompt. Run this sequence:

  1. Reproduce it once, deliberately. Do the exact same click/type sequence again. Note whether it happens every time or only sometimes — this alone changes how the AI should approach it.
  2. Open DevTools, reload, and look. Screenshot or copy anything red in the Console and anything red or non-2xx in the Network tab.
  3. Check how big the change was. Did the AI touch one small area, or did it say it modified many files / did something well beyond what you asked? This determines your revert-or-fix decision (Section 07).
  4. Write a two-line report, not a paragraph of feelings. "On the profile page, clicking Save does nothing. Console shows [paste]. This started after the last change." That's it.
  5. Ask the AI to explain before it fixes. "Explain what's happening here in plain English — don't fix it yet." Confirm the explanation actually matches what you observed before letting it write a fix.
  6. After the fix, re-run your regression checklist (Section 03) — not just the one broken feature. A fix for one bug is a common source of a second, new bug.

07 — The Decision Rule: Ask the AI to Fix It, or Revert?

This is the single most important judgment call in this layer, and it has a simple rule of thumb, echoed consistently across current AI-coding guidance: the smaller and more contained the damage, the more it's worth fixing forward; the bigger or more confusing the mess, the faster reverting wins.

Signal Fix forward Revert to last working version
Scope of the break One feature, clearly localized Multiple unrelated things broke at once
Your understanding You can describe exactly what's wrong You're not sure what even changed
Attempts so far First try at a fix AI has already tried twice and made it worse or weirder
What AI touched Only the files relevant to your ask AI says it modified many files "while it was in there"
Time spent Under ~10 minutes in 15+ minutes with no clear progress

This is exactly why Layer 06 emphasized saving frequent checkpoints (small commits, or your builder's version history) before letting an AI agent make a change: the revert option is only cheap if a recent working version actually exists to revert to. When in doubt, revert — a five-second rollback beats an hour spent arguing with an AI over an increasingly tangled explanation of its own mistake. You lose the botched attempt, not your product.

08 — Common Mistakes Beginners Make

  • Trusting "Done!" as proof. The AI's own completion message is a claim, not a test result — verify with your eyes and your checklist every time.
  • Only testing the thing you just asked for. Skipping the regression checklist is how a "small copy change" quietly breaks checkout three days later.
  • Pasting a screenshot instead of the actual error text. Text is searchable and exact; a screenshot forces the AI to guess at the words.
  • Vague bug reports. "It's broken" gives the AI almost nothing. "The console error, the exact click, and whether it's every time or sometimes" gives it everything.
  • Letting a fix spiral. Accepting attempt after attempt from the AI on the same bug, each one adding more unexplained changes, instead of reverting and starting the prompt over.
  • Chasing 100% test coverage. A handful of solid tests on the paths that matter beats a large pile of shallow ones — coverage is a means, not the goal.

Where this leads

Testing and triage are the habits that let you ship changes with confidence instead of dread — and that confidence matters even more once your app leaves the browser. Layer 10 — Shipping to Mobile takes this same non-coder verification mindset into a much less forgiving environment: app store review, device fragmentation, and bugs that only show up on a phone you don't own. The console-and-checklist instincts you just built are the foundation for testing something you can no longer just refresh in a browser tab.