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 1 of 6
You ask for tests and get eight passes
builds on: Spotting tests bent to pass, Verifying before you accept a change
Your project has `src/pricing.py` with a function `apply_discount(price, percent)` and no tests. You type:
▸ You: write tests for pricing.py
A minute later:
◂ Agent: Added 8 tests in `tests/test_pricing.py`. All 8 pass.
Eight passing tests feel like safety. But do they check what the function *should* do, or only what it happens to do today?
Terms on this card
- function
- A named, reusable block of code, like `get_data`, that other parts of the program call.
- tests
- Small pieces of code that run your program's code and check it gives the expected results.
- src
- Short for "source": a common folder name for a project's main code files.
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