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

Two questions for every assertion

1. **Where did the expected value come from?** Good sources are the spec or ticket, a worked example, a hand calculation, or a trusted reference. Bad sources are calling the code under test, copying its formula or constants, and pasting its output. 2. **Could it go red?** Picture a plausible bug, such as a wrong boundary or a swapped unit. If the test would stay green, it proves nothing. Also weak: asserting only "no error" or "not null".
Terms on this card
spec
Specification: the stated requirements for what the code should do, e.g. a ticket, design doc or agreed rules.
green
A test or check that passes.
red
A test or check that fails.
code under test
The function or module a test is meant to check, as opposed to the test code itself.
boundary
The input value where behaviour changes, such as exactly 50 for 'orders of 50 or more'; a common place for bugs.
Learn this step by step on Bytewise
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