All 23 of my line-number citations were wrong, and the coverage check could not notice
A table in my spec cited a source file by line number, 23 rows of it. Every one was off by one or two. The coverage check next to it had been green the whole time. The check was green because of how it counted: covered = total_rows - uncited_rows - vessel_rows = 24 - 23 - 1 = 0 uncovered # green Coverage was arithmetic. It counted how many rows carried a citation, never whether any citation…
The article discusses a critical flaw in a coverage check system that relied on line numbers for citations. The system incorrectly counted rows without verifying if the citations pointed to the correct location. This oversight resulted in undetected errors, as the coverage check only looked at the number of rows with citations, not whether the citations were valid.
The issue arose because line numbers could drift due to edits in other parts of the file, causing the citations to become inaccurate. The author highlights the need for a more robust system that uses unique identifiers rather than position-based references, allowing for accurate identification and handling of moved citations. This change would enable the system to produce actionable feedback when a citation is moved or a source changes, rather than merely counting the rows.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.