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.
Catch plausible-but-wrong code card 3 of 6

Seven questions, seven checks

builds on: Happy-path code: the edge cases it skipped, Text, time and money: classic data traps, Fine on test data, broken at scale, Unawaited async work and floating promises, Leaked resources: files, connections, goroutines, Races introduced by plausible concurrent code, Retrying operations that aren't idempotent, Half-finished changes: the call sites it missed, Refactors that quietly change behavior, Invented APIs, flags, config keys and packages
For each changed function, ask: 1. **Inputs:** empty, null, zero, boundary? → one targeted test 2. **Data:** non-ASCII, time zones, money? → a test with a real value 3. **Volume:** a query or full read in a loop? → query log, large fixture 4. **Async/resources:** all awaited, all closed? → linter, many-item run 5. **Shared state:** concurrent writes? → race detector, many-item run 6. **Retries:** safe if the first try succeeded but its reply was lost? → a test of exactly that, counting effects 7. **Reach:** all callers, same behaviour, real APIs? → repo-wide search, a test of the old edge case, docs for the installed version
Terms on this card
fixture
Prepared test data loaded before a test runs, such as a database seeded with 5,000 orders.
query log
A record of every database query the code sends. It shows when one query per loop item turns into thousands of queries.
linter
A tool that flags suspicious patterns in source code without running it.
race detector
A tool that instruments a program to report memory that several threads or goroutines access unsafely at runtime. In Go it is turned on with `-race`.
ASCII
A basic 128-character text encoding covering English letters, digits and common symbols, but no accents, other scripts or emoji.
Learn this step by step on Bytewise
Lesson goal: Find bugs in code that compiles, reads well and passes its tests: skipped edge cases, text, time and money traps, scale problems, unawaited async work, leaked resources, races, unsafe retries, missed call sites, behaviour-changing refactors and invented APIs. Choose the check that would expose each one. · the whole lesson