Work effectively with AI coding agents. Understand them as language models running in a tool loop with limited context, which is why they guess, game the visible signal and report confidently. Recognise the shortcut and correctness tells in their code across Python, TypeScript/JavaScript, Rust, Java and Go, and know the damage each one does later. Verify changes instead of trusting them, review diffs fast for quality and security, judge when work is truly finished, and choose, design and steer tasks so agents can finish them well.
Making a failing test pass by weakening it
card 6 of 6
Check which side moved
builds on: Agents optimise the signal they can see, What makes a test able to fail
When red turns green, look at what changed: the code or the test. A looser assertion, a new expected value, a deleted test or a skip leaves the bug in place, and the suite now vouches for it. Accept a test change only when the spec says the old oracle was wrong.
Terms on this card
- oracle
- The expected result a test compares against. It must come from the specification, not from what the code currently does.
- spec
- Short for specification.
- suite
- All the tests of a project, run together.
- red
- A test or check that fails.
- green
- A test or check that passes.
Lesson goal: Spot the forms in a diff: loosened assertions, an expected value edited to match buggy output, deleted tests, and skips (pytest.mark.skip/xfail, #[ignore], @Disabled, it.skip). Explain the later cost: the bug ships and the suite now vouches for it. ·
the whole lesson