Tests That Lie

The flaky test, the mock that drifted, 100% coverage with the bug intact: how test suites mislead the team that trusts them, and the habits that make a green build mean something.

13 LESSONS~200 MIN
START WITH FLAKY TEST FROM A RACE ▸ DRILL MODE ⏱

BEFORE YOU START

This path assumes you can already do the following. Each line says where ATLAS teaches it.

  1. 01 FLAKY TEST FROM A RACE A sleep is a guess about how long the other thread takes L215 MIN
  2. 02 ORDER-DEPENDENT TESTS Green in file order, red when shuffled L112 MIN
  3. 03 The mock that lied Green unit tests against a provider that no longer exists L216 MIN
  4. 04 100% coverage, bug intact Every line ran. Nothing checked the answer. L217 MIN
  5. 05 BOUNDARY VALUES Bugs live on the edge of a rule, so put a test on the edge L112 MIN
  6. 06 PROPERTY-BASED TESTING State what must always hold, then let the machine hunt for the input that breaks it L216 MIN
  7. 07 TIME IN TESTS A test that reads the clock passes on the day it was written L215 MIN
  8. 08 RETRIES HIDE THE BUG A pass on the second try is still a failure L216 MIN
  9. 09 Eventual Consistency in Assertions The sleep that fixed the flaky test until the replica got busy L215 MIN
  10. 10 Snapshot Tests The 400-line diff nobody reads before pressing update L112 MIN
  11. 11 TEST SELECTION Run the tests that depend on the change, not the tests next to it L215 MIN
  12. 12 DETERMINISTIC SIMULATION Run the distributed system under a scheduler you can replay L320 MIN
  13. 13 CAPSTONE: THE GREEN SUITECAPSTONE Three bugs, a green build and a 25-minute wait L322 MIN