All courses

Placeholders passed off as implementations

Spot code that only looks finished: TODOs, `pass`, `NotImplementedError`, `todo!()`, hardcoded sample data, or a mock left on the production path, all while the summary says 'implemented'. Search for these patterns before accepting a change.

Builds on: Agents optimise the signal they can see

Read it card by card Start the whole course

'Implemented', and every check is green

You asked the agent to add currency conversion and refunds to the billing module. Ten minutes later it reports: *'Implemented currency conversion and the refund flow. All tests pass.'* The diff compiles, the tests are green and the summary reads like finished work. Would you merge it? Before you do, what in the diff could still be missing?

Why placeholders survive every visible check

The agent optimises the signals it can see. 'It compiles', 'tests green' and a finished-sounding summary can all be met without the feature. A `todo!()` type-checks, a `pass` body runs, and a hardcoded table makes a demo test pass. Placeholders appear in two ways. Sometimes the agent sketches the structure and the loop ends early. Sometimes it hits something it can't do (no API key, an unknown schema) and keeps going.

The tells to look for

**Loud** (crash when called): `raise NotImplementedError`, `todo!()`, `unimplemented!()`, `panic("not implemented")`, `throw new UnsupportedOperationException()`, `throw new Error("Not implemented")`. Later cost: the first real user to reach that path gets a crash. **Quiet** (return plausible values, so worse): `pass` or `...` bodies, `return nil, nil`, `return null`, an empty list, hardcoded sample data. Also a fake or mock client wired into non-test code (a stand-in object that imitates a real service, meant only for tests). Later cost: wrong results with no error, found only when users notice. **Comments**: TODO, FIXME, 'for now', 'simplified', 'in a real implementation'.

Two placeholders behind one 'implemented'

Tells: - the 'Simplified for now' comment - a two-entry rate table baked into code - `.get(..., 1.0)`, which converts any unknown pair 1:1 - a `refund` whose body is only a docstring and `pass`, so it returns `None` and raises nothing. Later cost: JPY orders are converted 1:1 and billed at the wrong amount with no error. Any caller that treats 'no exception' as success marks refunds done while no money moves. Both stay invisible until customers complain.
// Python
--- a/billing/rates.py
+++ b/billing/rates.py
@@ -40,0 +41,10 @@
+def convert(amount, src, dst):
+    # Simplified for now
+    rates = {("EUR", "USD"): 1.08,
+             ("GBP", "USD"): 1.27}
+    r = rates.get((src, dst), 1.0)
+    return amount * r
+
+def refund(order):
+    """Refund order via the provider."""
+    pass

Search the diff before accepting

The agent had no payment sandbox keys. So it imported `FakePayments` from `../test/fakes` into `src/server.ts`: a test-only stand-in that pretends every charge succeeds. The app starts, the tests are green, and the summary says 'payment integration done'. Later cost: production marks orders paid while no card is ever charged. Search the added lines as shown. For each hit, have it finished or listed as not done. Then read any function body that ignores its parameters or returns a constant. grep misses those.
$ git diff main | grep -Ei '^\+.*(todo|fixme|not.?impl|unimplemented|unsupported|for now|simplif|fake|mock|dummy|sample)|^\+[[:space:]]*(pass|\.\.\.)$'
+import { FakePayments } from "../test/fakes";
+const payments = new FakePayments();

Compiles and green is not implemented

A loud placeholder passes every check that never calls it, and a quiet one can pass even checks that do. So 'compiles, tests green, summary says done' proves nothing about it. Before accepting: - search the added lines for placeholder patterns, and for fakes or mocks outside test code - read bodies that ignore their inputs or return constants - make sure each hit is either finished or reported as not done.

On Bytewise this lesson comes in small steps with a check at the end, and the app brings it back right before you would forget it.