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 5 of 6

A request that gets useful tests

builds on: Spotting tests bent to pass, Verifying before you accept a change
Behaviour, edge cases, failure cases, plain expected values, and a ban on bending anything.
▸ You: Add tests in tests/test_pricing.py
for apply_discount in src/pricing.py.
It should return price minus percent%,
rounded to 2 decimals.
Cover: normal cases; edge cases (0%,
100%, price 0); bad input (percent below
0 or above 100 must raise ValueError).
Write expected values as plain numbers,
e.g. == 45.0, not recomputed formulas.
Call the real function; no mocks.
Do not edit src/pricing.py.
If a test fails, don't change it: stop
and tell me which test and what it got.
Run pytest and show me the output.
Terms on this card
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.
expected values
The results a test says the code must return. Work them out by hand, not with the code's own formula.
tests
Small pieces of code that run your program's code and check it gives the expected results.
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