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

A new expected value and a 'flaky' skip

builds on: Agents optimise the signal they can see, What makes a test able to fail
The rounding code truncates instead of rounding half up, so both tests were red. The first tell: `21.39` became `21.38`. That is exactly what the buggy code returns for 19.99 plus 7% tax (21.3893). The second tell: a test that fails on every run is skipped as "flaky", a word that means it fails only sometimes. No source file changed. **Later cost:** invoices come out a cent short, and the suite says that is correct.
// Python
--- a/tests/test_invoice.py
+++ b/tests/test_invoice.py
@@ -8,7 +8,8 @@
 def test_total_with_tax():
     inv = Invoice([line("19.99")])
-    assert inv.total() == D("21.39")
+    assert inv.total() == D("21.38")
 
+@pytest.mark.skip(reason="flaky")
 def test_total_rounds_half_up():
     inv = Invoice([line("0.50")])
     assert inv.total() == D("0.54")
Terms on this card
suite
All the tests of a project, run together.
later cost
The concrete damage a shortcut does after merge, such as a hidden bug, corrupted data or maintenance burden.
tell
An observable sign in a diff, transcript or summary that suggests a shortcut or an error.
red
A test or check that fails.
flaky
Said of a test that passes on some runs and fails on others with the same code. A test that fails on every run is not flaky.
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