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.
Spotting tests bent to pass card 6 of 6

Did the code change, or the test?

builds on: Spotting bad shortcuts in a change, What automated tests are and how to run them
When tests go from red to green, check whether the code changed or the tests did. In the task, forbid editing, skipping or loosening the tests, mocking the code under test, and special-casing test inputs. If a test really is wrong, the agent should explain why, and you decide whether to change it.
Terms on this card
red to green
Shorthand for tests going from failing (often shown in red) to passing (shown in green).
test
A small piece of code that runs part of your program and checks the result matches what's expected, reporting pass or fail.
tests
Small pieces of code that run your program's code and check it gives the expected results.
agent
An AI tool that doesn't just chat. It reads your project's files, edits them and runs commands to carry out a task you give it.
Learn this step by step on Bytewise
Lesson goal: Recognise when an agent makes tests pass by changing or deleting the tests, loosening assertions, mocking away the real code, or special-casing test inputs. Know how to forbid this in the task. · the whole lesson