Developer finds test suite missed 1,029 lines due to tests built only on clean inputs
A software developer discovered that a security guard script meant to prevent cross-project file access was blind to 1,029 of 6,309 monitored lines, including 824 executable ones, despite three tests staying green for months. The flaw went undetected because all three tests used only clean, violation-free inputs, meaning a broken detector and a working one produced identical results. The core mistake, the developer explains, is building test suites solely from negative cases — files that should return no violations — which cannot distinguish a functioning rule from a completely blind one. The fix requires every detector test to include both a case that must trigger a finding and one that must not, ensuring neither a permissive nor a blind rule can silently pass. The developer also recommends validating tests against synthetic inputs and previous broken versions of the detector to confirm the new tests genuinely discriminate between correct and faulty behaviour.
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