Engineering Notes · agent operations · test quality

Test Debt Is The New Tech Debt

Lucas van Staden · ProxiBlue · November 2026 · proxiblue.com.au

Every ticket I ship now comes with its own regression tests. That is a good habit. It also means the suite only ever grows, and nobody looks at it as a whole. The debt did not go away when the code got cleaner. It moved into the tests. So I pay it down once a week, on a schedule, and never inside a feature ticket.

Where the debt went

Ok, so with AI-assisted development the tests come first. Each ticket gets its specs, they fail, the fix makes them pass, and the ticket closes. That part works well.

The problem is what happens over a year of it. Each spec makes sense on its own. Together they drive the same journeys over and over. On one client's Magento store the suite reached 893 tests, about 24,000 summed test-seconds (close to 7 hours of browser time, before any parallel split).

The first review found things like this:

None of that is wrong when you look at one ticket. It is only wrong when you look at the whole suite. And skipped tests are not free either. A test that is skipped forever still pays for its setup.

Why I don't clean up during feature work

The obvious fix is "tidy the tests while you are in there". I don't do that.

A feature ticket stays a feature ticket. If the agent working on checkout also starts merging other people's checkout specs, the diff grows, the review gets harder, and the feature ships later. Worse, a merge done in a hurry is how an assertion quietly disappears.

So cleanup is kept off feature tasks completely. It runs as its own scheduled review, once a week, with its own rules.

How the weekly review works

It is a project skill now, so the steps are the same every week:

  1. Inventory and slicing. List every test with its last measured duration, then cut the suite into slices.
  2. Seven read-only judges. Six each take a slice, and one looks across the whole suite for journeys driven more than once. They can read, not edit.
  3. Two skeptics per half. Every proposed cut gets argued against. A cut needs two of three votes to survive.
  4. An assertion ledger for every merge. Each line records the original assertion, the ticket it came from, and where it lives now. Nothing gets dropped without a new home.
  5. Owner approval. I read the ledger and approve or reject. Nothing is applied before that.
  6. Apply, with a failure proof. The cleanup runs as a normal planned task. Every carried check becomes a named test step, and each one has to be proven able to fail once (break the expected value, watch it go red, revert).
  7. A note for next week. Each review goes into my knowledge graph, so the next review knows what was already decided and why.

Step 6 is the one that matters most. A check that cannot fail is worse than no check, because it looks like coverage. So those don't get deleted, they get fixed.

The first review

The plan, before anything was applied:

The skeptics earned their keep. They cut the judges' journey savings by more than half. Some estimates added up both attempts of a retried test. One saving only existed because the dev site was misconfigured. Others counted whole-journey retries as normal runs. Without that second pass, the journey numbers would have looked about twice as good as the truth.

The biggest single lever is the serial lane from the parallel slots post. Some specs change admin config, so they run alone, at the end, never next to anything else. That lane is the critical path, and parallel slots can't touch it by design. It goes from 64 minutes to about 44.

Put together, the projected full run (main plus one slot) dropped from 116 minutes to about 71. That was an estimate from packing the lanes.

Applying it

The review was not always right. Some of its "identical" claims were wrong. Two tests looked the same but used a different cart, or ran in different browsers. Those cuts were refused or reversed. And a reviewer on the apply step caught 38 story annotations the merges had dropped, which would have failed the verify gate. They were put back before the commit.

Two bugs nobody was looking for

Making checks able to fail found two real product bugs. A company account's tax-exempt flag was not reset when the company was cleared. And a third-party tax module threw a script error on the account address form. The first turned up because a check was made able to fail. The second because its test moved under the gate that fails a test on console errors. Neither was in any ticket.

The nightly specs went from 52 tests to 9. Two of their screenshot baselines had been red for a while, and nobody noticed, because nothing ran the nightly specs. That is what a skipped test costs.

The measured runs

The 71-minute projection was for main plus one slot. By the time the cleanup landed, the suite ran on two slots (see the parallel slots post). So the fair comparison is two slots, before and after, three runs each.

The clock understates the gain. The after runs had a busier machine: load averaged 32 to 42 on 16 threads, against 23 to 33 for the before runs. A busy machine makes every test slower. I have no run at matched load, so I can't say how much is hidden. Summed test time went from 21,419 seconds to 18,529, 18,244 and 16,356.

It is not green yet

Every run after the cleanup had one or two failures and one to four flaky tests. All 190 planned spec files ran exactly once in each run (200 before), so nothing was lost or doubled. The problems traced so far are old races and defects that the load exposes, not coverage lost in the merges:

Two are still open. A shipping-rate error on one slot in the third run is not traced yet. And one journey the cleanup built flaked once on an aborted background fetch, so it still needs a wait.

Fewer, longer tests concentrate risk. One slow step now fails a 17-check journey, not one test. So merged journeys need more headroom. One ran 215 seconds under load against a 180-second limit. Four of them now get 300.

Win, win, win

Parallel slots split the work across more cores. This removes work. They stack.

What happens next

The review is on a schedule now. Every Monday at 03:00 it runs by itself, read-only. It posts its findings to me as a thread and never applies anything itself. Approval is still mine.

What I don't know yet is whether the suite grows faster than a weekly review can shrink it. The next reviews will tell, and I'll write a follow-up when they have.

Want to do this yourself?

The review skill, the assertion ledger and the test suite live in a private client repo, so there is nothing to link, and the numbers above come from that project's own run reports. What I can link is the rest of the series it builds on.

I use my tooling predominantly on Mage-OS (Adobe Commerce / Magento) e-commerce projects, and my own AI Booking Agent. If you have not swapped to Mage-OS yet, you are falling behind ;)

More in this series: Four Hours Is Too Long To Wait For A Security Fix — splitting a 4-hour Magento test suite across isolated full-stack copies of the site, built on request by a host-side agent. · QuietBookCut: The Hard Part Wasn't the Code — building QuietBookCut, and why getting the word out in a guarded craft niche is harder than writing the code. · Copies, Not Subscriptions — why every plugin and MCP server my agents load comes from a copy I hold, never live from upstream. · The Whole Stack, Reviewed Cold — a cold, independent critical review of the whole agent-operations stack, layer by layer, weaknesses included. · Logs Without the SSH Session — shipping Hypernode logs to self-hosted VictoriaLogs so agents can read them without SSH. · The Hour My Agents Spent Waiting For Nothing — why my agents are not allowed to background work they need the result of. · Smaller, Then Green — a mandatory cut-then-test loop that trims over-built code out of every plan's diff before any reviewer sees it. · Plans Run By A Fleet — how features run through a planned, adversarially-reviewed, parallel TDD pipeline instead of one long agent chat. · Hooks, Not Hopes — sorting every agent rule into prose or a blocking hook, and proving the hooks still fire. · The Agent Chatroom — giving the agents across my fleet a threaded chatroom so I stopped being the message bus. · The Commit That Has To Prove Itself — gating every commit behind recorded, state-hashed test evidence. · My AI Is Not Allowed To Guess — forcing blast-radius-first investigation and banning blame-shift excuses. · The Near-Miss That Banned Summaries — banning summarised page-fetches fleet-wide after a near-miss on a security advisory. · The Code Quality Checks Nobody Runs — coding standards, static analysis and comment hygiene moved into the commit path. · The ProxiBlue Debugger Discipline — blocking var_dump and wiring in real breakpoint debugging. · The ProxiBlue Domain Graph — giving my AI coding agents long-term domain knowledge with a temporal knowledge graph. · The ProxiBlue Falsifiable Rulebook — testing the rules and guard hooks that govern my AI coding agents.