Tests Should Explain Failures
Test-failure rules cover assertion shape and failure output that help humans and agents diagnose the failing case quickly.
Assertions and test failures that guide repair.
3 rules
Avoid Opaque Boolean AssertionsTEST-AVOID-OPAQUE-BOOLEAN-ASSERTIONSPrefer comparisons or richer assertions when a predicate hides state needed to diagnose the failure. The first failure should show the useful actual value.Optimize Failure OutputTEST-OPTIMIZE-FAILURE-OUTPUTDesign tests so failures include expected values, actual values, inputs, and contract context where that helps repair. Useful output shortens CI and agent debugging loops.Split Unrelated AssertionsTEST-SPLIT-UNRELATED-ASSERTIONSSplit assertions that diagnose different behaviors when one failure would hide another. Keep checks together only when they express one contract more clearly as a group.