Split Unrelated Assertions
TEST-SPLIT-UNRELATED-ASSERTIONS
Summary
Split 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.
Rule
Keep unrelated assertions separate when failure diagnosis matters.
Why
One test that checks parsing, formatting, ordering, error display, and cleanup may stop at the first failure and hide the real scope of the regression. Separate unrelated assertions when the failure modes require different fixes or explanations.
Helps
- Makes failures local to one behavior and prevents one broken check from masking another.
Limits
Keep related assertions together when they describe one contract and the combined output is clearer. Split when the assertions diagnose different behavior.
Agent Instruction
Split unrelated assertions because one failing check would hide the real scope or cause of a
regression.Mechanisms
Supported by named test cases, table-driven tests with case labels, focused regression tests, and assertion helpers that report the behavior under test.