Urgent.News

One page, thousands of outlets. See who else covered it.

Editions

Tech

A Detector That Only Ever Says "Clean" Proves Nothing

A few days ago I asked my agent to count how many of my tooling scripts carry a self-test. It grepped and answered: 12 of 13. The number was wrong. One script labels its control НЕГАТИВНИЙ КОНТРОЛЬ — uppercase — and the probe's regex was lowercase with no -i flag. The real answer was 13 of 13. A probe written to find blind detectors was blind. It returned a clean, specific, entirely plausible…

A self-testing detector that consistently reports "clean" is not sufficient to guarantee its reliability. One script in the author's project incorrectly labeled its control as "NEGATIVE CONTROL" due to a lowercase regex flag, resulting in 13 out of 13 tests appearing clean. This highlights the potential for detectors to miss issues if not tested properly.

The issue is amplified by the proliferation of detectors such as pre-commit hooks, custom lint rules, and audit scripts. These detectors run on every commit and often produce no output, which can create a false sense of security. A detector that finds no problems and another that cannot detect any problems output the same "clean" result, making it impossible to distinguish between a functioning detector and a broken one based solely on its output.

Mutation testing, which perturbs production code and re-runs tests, offers a potential solution. However, it is typically applied to core application code, not the smaller detector scripts written by developers. These smaller scripts often lack a mechanism to verify their own functionality, making them particularly vulnerable to false positives and false negatives.

To address this, the author proposes adding a '--self-test' flag to every detector, paired with positive and negative controls. The positive control should be a case that the detector is designed to catch, while the negative control should be an invented case that resembles a real one but is not. If any control fails, the detector should not print a verdict at all, but rather indicate that it is unsound.

By explicitly asserting the reliability of a detector through self-testing, developers can more confidently rely on the output of their quality assurance machinery.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Anti-Social Media

  • Social media has become weaponized platform of distraction, propaganda, and rage.
  • Platforms like Meta and X promote pre-made memes, AI-generated content, and sound bites.
  • Engagement-driven approach turns users into content creators and interaction baiters.

CanineIQ - Are You Actually Ready for the Dog You Want?

This is a submission for Weekend Challenge: Dog Days Edition What I Built I watched the CCTV footage in this India Today report of a couple being mauled by a pitbull while they viewed a rental home.

  • CanineIQ assesses dog owners' readiness through eight critical questions.
  • Users receive readiness score, dog's perspective letter, and breed health transparency.
  • Tool provides deterministic, unbiased evaluation of breed needs and costs.

Microsoft.Testing.Platform Crash-Resilient TRX: Keep Evidence When the Host Dies

When a test process dies, a red CI job is not enough. I need to know what completed and what was running when the host disappeared.

  • Microsoft.Testing.Platform introduces crash-resilient TRX files
  • Preserves completed results during host crashes, includes in-flight tests
  • Enables with .NET 10, MSTest.Sdk 4.3.3, and Microsoft Testing Extensions

More from Sunday 16 August →