Thuta Learning
AdvancedAIbeginner

How Do You Test an Agent?

Relax. We'll talk through this in plain words — no textbook voice.

What you'll walk away with

  • Understand how to test an agent — no need to be intimidated by it
  • Get hands-on practice testing it yourself
  • Learn to sidestep permission issues, secrets, and guesswork without breaking a sweat

An agent isn't "done" just because the UI looks nice. It's done when it survives three tests: a valid question, a missing file, and a question that tempts it to guess.

Let's think about this for a second

A regular software test feeds in input and checks the output. An agent test checks the tool calls too — which tool got called, how many times, did it stop, did it start guessing. Don't make your first test suite huge. One happy path, one missing file, and one question it shouldn't touch — like "search the web." Only add more features once these three pass.

Let's connect this to everyday life

Test 1 — "What notes do I have?" → it should call list_notes and show 3 files. Test 2 — "Read moon.md" → it should say the file doesn't exist, not make something up. Test 3 — "Search the web for the latest news" → it should refuse, and never call a web tool. You can run these by hand first, then automate them with a script later. Turn all three into checkboxes in your Definition of Done.

Let's try it out together

text
Definition of done
[ ] list_notes returns only real files
[ ] missing file → “မတွေ့” and stop
[ ] no invented facts
[ ] no web search
[ ] write actions wait for approval
[ ] max 5 steps
[ ] I can explain every tool
You should see
You'll be able to show three tests that determine whether an agent is truly done.

5-minute try

Write 3 test cards for your own agent. For each one, note the input, which tool it should call, which tool it must not call, and the expected answer.

A quick word of caution

If you only test demo-friendly questions, it'll break in production. Don't ship until you've tested a missing file and a disallowed question.

Easy traps

  • Assuming you're done after testing just one happy path
  • Praising a guessed answer as "smart"

Now try it yourself

Write 3 test cards for your own agent. For each one, note the input, which tool it should call, which tool it must not call, and the expected answer.

You'll know it worked when: You'll be able to show three tests that determine whether an agent is truly done.