A 4-person team's SaaS backend had been running for two years with core billing-module test coverage stuck at 31% — not from indifference, but because nobody could carve out two uninterrupted weeks to fix it. Before any big change, someone had to manually re-verify production wasn't broken, and shipping still felt nerve-wracking afterward. This is exactly the kind of work — known to matter, never scheduled — that suits a R&D avatar: the task boundary is clean (tests only, no logic changes), the result is measurable (a coverage number), and it doesn't eat into engineers' time on actual feature work.
The rule first: add tests only, never touch logic
The one instruction the team gave the avatar: "tests only, not one line of business logic." With that boundary locked, review got simple — just check whether the diff touches any business `.ts`/`.js` file; if it does, it's rejected. The avatar scanned the billing module function by function, ranked them by cyclomatic complexity and historical bug density, and started with the highest-risk one: the currency-conversion function.
A side effect of backfilling: 3 unknown edge-case bugs surfaced
Writing a test case for a function that's never had one forces you to first nail down what it's "supposed to" do under every input — that process is itself a review. While writing boundary cases for the currency-conversion function, the avatar found that when the exchange rate is 0 (the default fallback when the third-party API times out), billing output becomes `Infinity` instead of raising an error — a bug that had been live in production for at least 8 months, just never triggered hard enough for anyone to notice.
We just wanted to pay down the test debt — we didn't expect to accidentally dig up a real bug that had been sitting there for the better part of a year.
Co-founder, the team above
How to tell real coverage from a padded number
Coverage percentage alone can lie — testing only the happy path inflates the number without verifying any edge case. The team required that in every batch the avatar returned, negative cases (bad input, boundary values, third-party dependency failures) make up at least 30%, and every new test had to be able to state what it's guarding against — not just exist to turn the coverage tool green.
Will it write meaningless tests just to pad the coverage number?
The team set a hard requirement: at least 30% negative cases, and every test needs a one-line comment stating what it guards against. Tests that only assert "the function was called," with no meaningful check, get rejected outright.
What about existing flaky tests — does it fix those too?
Fixing existing tests was out of scope for this task — it only added new coverage. The team later ran a separate pass scoped to "fix flaky tests only, add nothing new," using the same test-files-only permission setup.
Build a sovereign AI avatar that answers only to you
The machine is yours, the files are yours, and so is the memory — it lives in a file you can take with you. What it may and may not touch is your call. The KarmaBox web client needs no install.
Try Karma Web →



