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

What a bent test looks like in a diff

builds on: Spotting bad shortcuts in a change, What automated tests are and how to run them
This is the agent's change to the test file. The first test now passes for any result, even the wrong `100`. The second test was also failing, and it was silenced, so `pytest` will report `1 skipped` instead of a failure. Neither change touched the actual bug in `apply_discount`.
--- a/tests/test_prices.py
+++ b/tests/test_prices.py
@@ -8,6 +8,7 @@ def test_discount():
     total = apply_discount(100, "SAVE10")
-    assert total == 90
+    assert total is not None
 
+@pytest.mark.skip(reason="flaky")
 def test_expired_code():
     total = apply_discount(100, "OLD5")
     assert total == 100
Terms on this card
pytest
A popular Python tool that finds and runs a project's tests, then reports how many passed, failed or were skipped.
skipped
A test the runner was told not to run. It is reported as skipped, not as failed, so a skipped test can hide a bug.
diff
A listing of what changed between two versions of files: removed lines start with '-', added lines start with '+'.
test
A small piece of code that runs part of your program and checks the result matches what's expected, reporting pass or fail.
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