No fluff. Just a practical guide to diagnosing bad tests and fixing them fast.
You know tests are important. But not all tests are good.
Many tests slow you down:
If Tier 1 fails, the test is worthless. Fix or delete immediately.
If Tier 2 fails, debugging takes 10x longer.
If Tier 3 fails, tests rot over time. Only matters if test is worth keeping.
Have a symptom? Quick lookup:
Visit Examples and click the law filter. Each example is tagged with violated laws.
Each example shows bad code, good code, and why the fix works.
Block merge if:
sleep() or has race conditionsRequest changes if:
Suggest improvement if:
Pro tip: Link to specific law pages in your review comments. "This violates Law #3: Determinism" is more helpful than "this is flaky."
Don't over-invest. Bad tests are worse than no tests.
If a test never fails, tests trivial logic, or is too expensive to fix: delete it (Law #9: Maintenance).
1. Diagnose your test problem (flaky? cryptic? brittle?)
2. Identify which law it violates (use the symptom table)
3. Filter examples by that law
4. See concrete bad/good code
5. Apply the pattern to your codebase
Goal: Identify and fix (or delete) low-value tests in <60 seconds.