SShortSingh.
Back to feed

Developer discovers coverage check that could only ever show 100% by design

0
·3 views

A software developer found that a code coverage check in their project always displayed 13/13, not because coverage was genuinely complete, but because both the numerator and denominator were derived from the same array. Since the numerator was simply the array mapped through a function, its length could never differ from the denominator, making failure mathematically impossible. The real risk — an error case with no matching classifier arm — was invisible because missing entries were absent from both sides of the fraction simultaneously. The fix involved replacing the denominator with an independent source, the full set of known error kinds, so any gap would cause the ratio to drop. The developer has since added an 'aggregation gap' audit rule to automatically flag coverage checks where the numerator and denominator share the same source.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingHacker News ·

Analysis Claims Claude AI Tends Toward Contrarian Responses

A Medium article by user rdsubhas argues that Anthropic's Claude AI model exhibits contrarian behavior in its responses. The piece was shared on Hacker News, where it gathered modest engagement with 8 points and 1 comment. The author suggests Claude has a tendency to push back or disagree rather than align with user inputs. The article raises questions about how Claude's training may influence its conversational style. The post has sparked limited but notable discussion in the developer community.