Does It Still Work?
Two everyday questions run through every project. Tests tell you the code still works. Debugging is how you find out why it doesn’t. This lesson gives you a practical grip on both.
Tests Come in Layers
They differ by how much of the system each one exercises — from one small piece to the whole thing.
- Unit — checks one small piece on its own, like a single function.
- Integration — checks that pieces work together correctly.
- End-to-end — runs the whole flow the way a real user would.
What a Test Actually Is
A test is just code that runs your code with a known input and asserts the expected output. If the two disagree, the test fails.
Debugging Is a Method
When something breaks, don’t guess — work through it in order.
- Reproduce the bug reliably, so you can tell when it’s fixed.
- Read the stack trace — it names the file and line where things went wrong.
- Form a hypothesis about the cause.
- Change one thing, then check — and repeat until it holds.
How You Trust an Agent
Tests are how you trust the code a coding agent writes for you. If the tests pass, the change is probably safe. This is the everyday version of verify, don’t trust blindly.
Build It
How to implement: pick one function in your tool and write a single test — given this input, expect this output. Then run it and watch it pass.
- Weekly AI Tasks tracker — a test like “this message parses into this task” catches regressions in the parser, and is the seed of the evals you build in Module 8.
- Personal brand site — a simple check that every project link resolves and every claim has a source keeps it honest.
What you learned
Tests come in layers — unit, integration, end-to-end — and each one runs your code with a known input and asserts the result. Debugging is a method: reproduce, read the trace, hypothesise, change one thing, check. Together they are how you trust code, including an agent’s.