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.
What makes a test able to fail
card 2 of 6
A test is inputs plus an oracle
Every test has two parts: inputs, and an **oracle**, the expected result it compares against. A test is only as good as where its oracle came from.
The agent writes tests while looking at the code. The easiest oracle is whatever the code already does: copy its formula, or run it and paste the output. That reliably turns the tests green, which is a proxy signal. **Later cost:** the bug is now locked in as "expected", and the correct fix later turns a test red.
Terms on this card
- oracle
- The expected result a test compares the code's actual output against; it decides pass or fail.
- proxy signal
- A visible stand-in for the real goal, such as tests passing, that can be satisfied without the goal actually being met.
- Later cost
- The concrete damage a shortcut does after merge, such as a hidden bug or extra maintenance.
- green
- A test or check that passes.
- red
- A test or check that fails.
Lesson goal: Explain a test as inputs plus an oracle, the expected result. The oracle must come from the specification rather than from the code under test. A test that cannot go red when the code is wrong proves nothing. ·
the whole lesson