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:
- Category price-sort tests that compared an array with itself. They could never fail.
- The same card-payment 3D Secure flow, run six times by six different specs.
- Twelve separate single-item checkouts, each one there to check a single database column.
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:
- Inventory and slicing. List every test with its last measured duration, then cut the suite into slices.
- 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.
- Two skeptics per half. Every proposed cut gets argued against. A cut needs two of three votes to survive.
- 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.
- Owner approval. I read the ledger and approve or reject. Nothing is applied before that.
- 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).
- 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:
- 226 findings. Both skeptics confirmed 128, corrected 75 and rejected 11. The other 12 were split votes, so they came to me as decisions.
- The plan is 181 cuts in 21 work packages, plus 41 decisions for me.
- Tests go from 893 to about 630. Around 270 leave the run, and 19 new journey tests take their place.
- Summed test time goes from 24,050 seconds to about 14,930 (38% less).
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
- 53 tasks. 160 files changed: 8,992 lines added, 9,967 removed.
- This store's own tests went from 364 to 272. Shared tests that don't apply to this store are now skipped or left out, instead of running for nothing.
- Every carried check is a named step in a journey test, and every one was shown failing once.
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.
- Before: a median of 1h16m22s, about 770 tests run.
- After: 1h02m38s, 59m51s and 57m02s, with 633 tests run each time. The median is 59m51s, which is 22% faster.
- The serial lane: about 60 minutes before. After: 46½, 46 and 49. The plan said about 44.
- Since the start: 4h07m serial, then 2h58m after the first serial fixes, 1h56m with one slot, 1h16m with two, and now just under an hour. That is 76% off.
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:
- An aborted cart-totals request that trips the console-error gate. The same test family, in all three runs.
- A polling bug in one express-wallet test.
- An add-to-cart racing a logout redirect.
- An error-tracking check that assumed it ran on the main site. It failed the first time its spec landed on a slot. Fixed.
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
- Faster runs. Less work per pass, and the serial lane gets shorter, which is the part parallel runs can't fix. 22% off the median, measured on a busier machine.
- Better coverage. Checks that could never fail get fixed and proven, not deleted. Two real bugs turned up on the way.
- Less code. Close to a thousand lines fewer, and 92 fewer tests for this store. Fewer to read, fewer to maintain, fewer to break when the checkout changes.
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?
- Keep cleanup out of feature tickets. Give it its own slot in the week.
- Read-only judges first, skeptics second. The agent that proposes a cut should not be the one that approves it.
- Keep an assertion ledger. Every assertion that moves gets a line: where it came from, where it lives now.
- Prove every carried check can fail. Break it, watch it go red, put it back.
- Look for the serial lane. Whatever must run alone sets the floor for everything else.
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.