Go from never having used a coding agent to working productively and safely with one. The learner should understand what an agent is and how it differs from a chat assistant. They should choose a tool, set up a protected first project, describe tasks the agent can do well, and follow and verify its work. They should recover from bad changes, manage context, and plan bigger changes. They should also use tests as the definition of done and run everyday workflows (bug fixes, features, writing tests, codebase exploration, scripts, small tools, refactors). Throughout, they should keep secrets and systems safe and keep their own understanding growing instead of outsourcing it.
Workflow: having the agent write tests card 3 of 6

A routine for agent-written tests

builds on: Spotting tests bent to pass, Verifying before you accept a change
1. Commit first, so `git status` is clean. 2. State the intended behaviour. List edge cases (empty, zero, limits) and failure cases (bad input). Forbid edits to the code being tested. 3. Read each test. Expected values should be plain numbers, like `== 45.0`. 4. **Break check:** make the code wrong, run the tests, and expect failures. Then undo. 5. A failing test is your decision: is the code wrong, or the test?
Terms on this card
test
A small piece of code that calls your code with chosen inputs and checks the result matches what you expect.
edge cases
Inputs at the limits of what the code handles, such as zero, empty, the maximum allowed value or exactly on a boundary.
failure cases
Invalid inputs where the code should refuse, for example by raising an error, instead of returning a wrong answer.
Break check
Deliberately making the code wrong, running the tests to see them fail, then undoing the change. It proves the tests can catch mistakes.
expected values
The results a test says the code must return. Work them out by hand, not with the code's own formula.
Learn this step by step on Bytewise
Lesson goal: Get useful tests for existing code by asking for behaviour-focused cases, edge cases and failure cases. Check that each test would fail if the code were broken, and decide what to do when a test exposes a real bug. · the whole lesson