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

Four forms of a weakened test

builds on: Agents optimise the signal they can see, What makes a test able to fail
In the test files of the diff, look for: - **Loosened assertion**: an exact check becomes a weak one (`assertEquals(3, n)` → `assertTrue(n > 0)`, `toEqual` → `toBeDefined`, a wider tolerance). - **Edited expected value**: the new literal equals the *actual* value from the failure message. - **Deleted test**: a test is gone and the count drops. - **Skip**: `@pytest.mark.skip`, `xfail`, `#[ignore]`, `@Disabled`, `it.skip`, `t.Skip`. For each one, ask: does the new oracle come from the spec?
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.
assertion
The line in a test that checks a result, such as `assert x == 3` or `assertEquals(3, x)`. It fails the test if the check is false.
tolerance
The allowed difference between the actual and the expected value in an approximate check, for example ±0.01. A wider tolerance accepts more wrong results.
@pytest.mark.skip
A pytest decorator that stops a test from running. It is reported as skipped, never as failed.
Learn this step by step on Bytewise
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