<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Anatoly Khelmer</title>
    <description>The latest articles on DEV Community by Anatoly Khelmer (@anatolykhelmer).</description>
    <link>https://dev.to/anatolykhelmer</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4125680%2Fdfad7ea9-2298-471d-addd-92693b90e9ef.png</url>
      <title>DEV Community: Anatoly Khelmer</title>
      <link>https://dev.to/anatolykhelmer</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anatolykhelmer"/>
    <language>en</language>
    <item>
      <title>I deleted a condition from a library with 100% coverage. CI stayed green.</title>
      <dc:creator>Anatoly Khelmer</dc:creator>
      <pubDate>Tue, 15 Sep 2026 09:17:50 +0000</pubDate>
      <link>https://dev.to/anatolykhelmer/i-deleted-a-condition-from-a-library-with-100-coverage-ci-stayed-green-o6k</link>
      <guid>https://dev.to/anatolykhelmer/i-deleted-a-condition-from-a-library-with-100-coverage-ci-stayed-green-o6k</guid>
      <description>&lt;p&gt;I deleted &lt;code&gt;!arrays ||&lt;/code&gt; from a guard in &lt;a href="https://github.com/radashi-org/radashi" rel="noopener noreferrer"&gt;radashi&lt;/a&gt;, a TypeScript utility library that gates CI on 100% line and branch coverage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// before&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;arrays&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;arrays&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="c1"&gt;// after&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;arrays&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I ran their actual CI command, &lt;code&gt;pnpm test&lt;/code&gt;. All 911 tests passed. Coverage still reported 100% lines and 100% branches — including on &lt;code&gt;unzip.ts&lt;/code&gt;, the file I had just edited.&lt;/p&gt;

&lt;p&gt;That isn't a radashi problem. Their suite is better than most I read. Coverage counts how often an operand is &lt;em&gt;evaluated&lt;/em&gt;, never whether it &lt;em&gt;decided&lt;/em&gt; anything. A suite can sit at 100% and still let you delete a condition.&lt;/p&gt;

&lt;p&gt;I picked radashi for that reason, not because it is famous. It enforces &lt;code&gt;thresholds: { 100: true }&lt;/code&gt; in Vitest. If a suite gated at 100% still has a deletable condition, the metric is the problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  What coverage cannot say
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;if (!arrays || !arrays.length)&lt;/code&gt; is two questions. A V8 coverage provider typically records that the branch ran. It does not record whether &lt;code&gt;!arrays&lt;/code&gt; ever did any work. If every test already passes a defined array, you can delete the nullish check and the score does not move.&lt;/p&gt;

&lt;p&gt;The suite is not a paper tiger. Blanking an unrelated guard in &lt;code&gt;replaceOrAppend&lt;/code&gt; to &lt;code&gt;if (false)&lt;/code&gt; failed a test. The harness kills mutants. It just does not kill this one.&lt;/p&gt;

&lt;h2&gt;
  
  
  DeepCover
&lt;/h2&gt;

&lt;p&gt;I wrote &lt;a href="https://github.com/anatolykhelmer/deepcover" rel="noopener noreferrer"&gt;DeepCover&lt;/a&gt; to score whether tests actually verify the code, not whether they executed a line. Three stages:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;extract&lt;/strong&gt; — parses a module into a code model: every branch with &lt;code&gt;||&lt;/code&gt; / &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt; operands split apart, every test mapped to the function it targets, the dependency graph, per-function coverage merged in. Optional Jest/Vitest reporters add per-test pass/fail.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;reason&lt;/strong&gt; — your coding agent gets structured prompts against that model: which domain states exist and which are tested, how strong each assertion is, how critical each function is, what's covered transitively, and where tests create false confidence. The agent writes typed JSON. You are not pasting files into a chat.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;analyze&lt;/strong&gt; — composite plus sub-scores, per-function breakdown, ranked gaps. LLM influence is capped at ±20% per sub-score so the number does not swing with model mood.&lt;/p&gt;

&lt;p&gt;On radashi's &lt;code&gt;src/array&lt;/code&gt; — 35 functions, 911 tests, 100% coverage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Composite 89/100
  Assertion Quality  100
  State Coverage      63   ← 37 of 112 domain states untested
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A domain state is a situation the function's logic can be in — empty vs non-empty, a filter that removes everything, a custom matcher — not "this line ran." The tests that exist are written well. About a third of the states the reasoner found have no test at all. Line coverage cannot say that.&lt;/p&gt;

&lt;p&gt;I probed a few of those gaps by inserting a &lt;code&gt;throw&lt;/code&gt; and re-running the suite. It stayed green for &lt;code&gt;iterate&lt;/code&gt; with &lt;code&gt;count &amp;lt;= 0&lt;/code&gt;, and for &lt;code&gt;select&lt;/code&gt; when a non-empty input is filtered to nothing. The state is in the source. No test ever puts the function there.&lt;/p&gt;

&lt;h2&gt;
  
  
  A team that already knew
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/sodiray/radash" rel="noopener noreferrer"&gt;radash&lt;/a&gt;, the library radashi forked from, cannot toggle &lt;em&gt;any&lt;/em&gt; falsy value out of a list: &lt;code&gt;0&lt;/code&gt;, &lt;code&gt;''&lt;/code&gt;, and &lt;code&gt;false&lt;/code&gt; are all treated as missing. radashi found that, fixed it, and added a test named &lt;code&gt;'should work with falsy values'&lt;/code&gt; covering &lt;code&gt;0&lt;/code&gt; and &lt;code&gt;null&lt;/code&gt;. CI still gates on 100% coverage.&lt;/p&gt;

&lt;p&gt;The last falsy case is still wrong. Both &lt;code&gt;toggle&lt;/code&gt; and &lt;code&gt;selectFirst&lt;/code&gt; use &lt;code&gt;Array.prototype.find&lt;/code&gt;, which returns &lt;code&gt;undefined&lt;/code&gt; for "nothing matched" &lt;em&gt;and&lt;/em&gt; for "the matching element is &lt;code&gt;undefined&lt;/code&gt;". A matcher that hits &lt;code&gt;undefined&lt;/code&gt; looks like a miss: &lt;code&gt;toggle&lt;/code&gt; appends instead of removing, &lt;code&gt;selectFirst&lt;/code&gt; never runs the mapper.&lt;/p&gt;

&lt;p&gt;The extract step put those operands and tests next to each other. The reasoning step flagged both. I opened &lt;a href="https://github.com/radashi-org/radashi/issues/482" rel="noopener noreferrer"&gt;radashi#482&lt;/a&gt; and &lt;a href="https://github.com/radashi-org/radashi/issues/483" rel="noopener noreferrer"&gt;radashi#483&lt;/a&gt;. The repro is narrow — you need an &lt;code&gt;undefined&lt;/code&gt; element, and for &lt;code&gt;toggle&lt;/code&gt; a custom key function — and that is the point. A team that already knew about this class of bug, named a test after it, and enforced 100% coverage still missed one. Coverage had nothing left to say.&lt;/p&gt;

&lt;h2&gt;
  
  
  Honest limits
&lt;/h2&gt;

&lt;p&gt;The full score uses a coding agent as the reasoner. This is not a linter you drop into CI unattended (&lt;code&gt;--no-llm&lt;/code&gt; is deterministic-only).&lt;/p&gt;

&lt;p&gt;The deterministic bug pass is noisy on purpose. The reasoning pass validates each signal; on this run it rejected all seven as false positives.&lt;/p&gt;

&lt;p&gt;This run had no per-operand branch data (Vitest 2's v8 provider), so that check was disabled rather than guessed. The deleted &lt;code&gt;!arrays ||&lt;/code&gt; above is a hand edit I ran against their suite, not a mutation-testing feature.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx @anatolykhelmer/deep-cover@0.10.1 run &lt;span class="nt"&gt;--root&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;--module&lt;/span&gt; src/foo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I wrote it: &lt;a href="https://github.com/anatolykhelmer/deepcover" rel="noopener noreferrer"&gt;github.com/anatolykhelmer/deepcover&lt;/a&gt;&lt;/p&gt;

</description>
      <category>testing</category>
      <category>typescript</category>
      <category>opensource</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
