Skip to content
FlintFlintby Torch
← LevelsBuilder · B5

Tests as verification

Build-along · ~10 min at your own keyboard

Anything with rules — a calculation, a sorter, a template filler — can carry its own tests: 'given these 3 inputs, the output must be exactly this.' Have Claude write the checks alongside the work, and every future change gets caught the moment it breaks something.

The long version: Tests as verification ↗

Mac: Mac: run tests in Terminal, for example python3 test_file.py or npm test.

Windows: Windows: run tests in PowerShell, for example python test_file.py or npm test.

Do this

0/4

Checkpoints

  • ▸You should now see 3 hand-written cases, including one edge case.
  • ▸You should now see Claude run those cases and report pass or fail.
  • ▸You should now see a case fail loudly after you change a rule.
The three ways this goes wrong
  • Claude writes tests that only confirm its own code. — Write the cases yourself first and give them as the spec.
  • The tests do not run. — Ask Claude to show the exact command it used, run it yourself, and read the output.
  • Everything passes after the rule change. — Your cases do not touch that rule. Add a case that does.

Share what happened

Paste your 3 hand-written cases and the pass/fail results across both runs.

Strip API keys, passwords, and tokens before you paste. Swap them for [KEY].

🔒 Don't paste confidential, personal-health, or payment info.