DevConnectDevConnect
Sign up · Log in
← back to the feed
0

I Counted the Assertions in Our Test Suite. I Wish I Hadn't.

TL;DR: A Friday afternoon audit of a 400-spec test suite revealed many tests lacking real assertions, exposing hidden quality issues. The findings highlight four common anti-patterns that inflate coverage without true verification. A developer counted assertion calls across 400 specs and found 61 tests with zero assertions, despite passing. Closer inspection exposed four patterns: existence checks that verify object presence without verifying behavior, soft asserts that never trigger due to missing assertAll, tautologies that pass regardless of actual outcomes, and tests that count steps rather than performing meaningful checks. The post reflects on how such patterns can mislead stakeholders and obscure true test quality. It underscores the risk of equating test activity with test correctness and urges more deliberate assertion strategy. Question for the room: Which assertion anti-pattern have you encountered most often, and how did you address it in your project? — via dev.to
Add a comment
0/2000