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

Break check, then a real bug

builds on: Spotting tests bent to pass, Verifying before you accept a change
With the better request (next card), the agent replies: ◂ Agent: 9 pass, 1 fails: `test_rejects_over_100`. `apply_discount(50, 200)` returns -50.0, not `ValueError`. Break check: change `1 - percent / 100` to `1 + percent / 100` and run `pytest`. The normal cases and the 100% case now fail. The 0%, price-0 and below-0 tests still pass, because this change can't affect them. Undo it; `git diff src/pricing.py` is empty. The failing test found a real bug. Keep the test and fix the code as a separate, reviewed change.
Terms on this card
pytest
A popular Python tool that finds and runs test functions, then reports which passed and which failed.
test
A small piece of code that calls your code with chosen inputs and checks the result matches what you expect.
ValueError
A standard Python error raised to say a value has the right type but is not acceptable, such as a discount of 200%.
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.
git diff
A git command that shows exactly which lines changed since the last commit. Empty output means no changes.
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