My previous articles were about infrastructure: hypervisors, backups, firewalls. This one is about a different kind of project, riskier and more interesting: replacing a business application, the one teams use all day long and whose numbers go straight out to clients.

When you replace infrastructure software and do it well, nobody notices. When you replace business software, everybody does. The smallest gap in a result is spotted within a minute, and lost trust does not come back. Here is the method I followed to build an in-house calculation engine, put it into production for several teams within a few weeks, and never give a user a reason to doubt their numbers.

The problem: every workstation computed its own truth

The calculation lived in Excel, on each user's workstation, through a vendor-supplied add-in. That model had reached its limits:

  • every workstation recomputed the same results on its own. When one got it wrong, its result overwrote everyone else's under a "latest wins" rule;
  • input data came from each user's own terminal, with different entitlements from one workstation to the next;
  • the add-in crashed Excel in under ten minutes for one user;
  • synchronisation between workstations relied on a file share and autosave, both of which can fail without making a sound.

The diagnosis was clear: the calculation had no business running on workstations. It had to live on our servers, one instance per team, with Excel reduced to input and display.

The golden rule: reproduce before you improve

When you rewrite a tool, the temptation is to make it "better" from day one. That is the surest way to fail. If the new engine gives a different result from the old one, nobody can say which is right, and users will keep the old one.

So I set an unambiguous target: the same values as the tool in place, to four decimal places. Not "close", not "consistent": the same. Improvements would come later, once trust was earned, and each one would be an explicit decision.

Three technical choices followed:

  • a server-side engine, isolated, deployed on our container platform;
  • a well-established open source calculation library rather than hand-written formulas;
  • no new Excel add-in to install: one more module in the tool the teams already had.
If the new tool gives a different number from the old one, nobody knows which is right. And users keep the old one.

Measure the gap, never tune it away

The heart of the method fits in one sentence: you measure the gap, you never disguise it.

For every result to reproduce, I extract a reference set from a real user workbook, read-only. That set becomes an automated test with a written tolerance. If the engine drifts, the test fails, and the gap has to be explained.

What I forbid myself: tweaking a parameter until the number lands. A setting that "fits" one day of data stops fitting the next. Instead, you look for the rule. One example: a gap kept showing up at the far end of the calculation. It was not an accuracy issue but an undocumented convention of the original tool, which we recovered by measurement and which held exactly across every data set. Once that rule was written into the engine, the gap dropped to zero, without a single tuned parameter.

On day one the engine had sixteen tests. Four days later, sixty-four. Every convention we uncover becomes a test, and can never silently regress again.

1. Reproduce reference sets automated tests 2. Measure the gap, never tune it away 3. Lab parallel agents, human re-measure 4. Live bench every 5 minutes, 95% over 5 days 5. Cutover business sign-off, explicit decision gate: every gap explained gate: criterion met
Five steps and two gates. Nothing enters the engine without an explained gap, nothing cuts over without the criterion met.

A lab, and AI agents that propose without deciding

Finding a hidden convention means forming hypotheses and eliminating them one by one. That is where AI changes the scale of the work.

I set up a lab separate from the repository: each hypothesis is tested in an independent copy of the code, replayed against an already extracted data snapshot, without ever touching the repository or production. Several AI agents explore families of hypotheses in parallel, each in its own copy. Another agent is tasked with tearing their conclusions apart.

And one rule I do not negotiate: no agent report is taken at face value. Before a hypothesis enters the engine, I re-measure it myself with my own tools. An agent can find in an hour what would have taken me a week. It can also be wrong with great confidence. The measurement decides, not the report.

An agent can find in an hour what would have taken me a week. It can also be wrong with great confidence. The measurement decides, not the report.

The days that bite

Once the engine matched, a second front opened: the calendar. On certain days the gap came back, across every result at once or on a single one. Three examples:

  • on the eve of a holiday observed in a single country, a start date shifted by one day;
  • the original tool kept hand-entered, frozen values that skewed its own results on those days;
  • its calendar still contained a Danish public holiday abolished in 2024.

In that last case, the original tool was the one in error. The temptation would be to copy its mistake to get back to equality. I did not. Those days are identified, proven, excluded from the verdict, and whether to follow the old tool remains a human, documented decision. Since then, one rule applies to every new building block of the engine: it is tested on a weekend and on the eve of a holiday before it ships.

A test bench that never sleeps

Tests on reference sets are not enough: production means data that moves all day. So I added a continuous test bench. Every five minutes during business hours, the new engine and the old tool compute from the same inputs at the same instant, and the gap is recorded.

The criterion for declaring a team ready is written in advance: 95% of measurements within tolerance, five consecutive business days. Gaps show up on a dashboard and trigger an alert. It is no longer my impression that says the engine is right, it is a chart anyone can look at.

Going live without making users nervous

The deployment discipline is the same as for infrastructure, with one extra requirement: the user must never be the one who discovers a problem.

  • Build in parallel. Every new screen is built and tested on real data, read-only, before any cutover. Production is only touched for a short switch.
  • Sign-off by the business user. They validate it on their own work, not me on a screenshot.
  • Production only on an explicit decision, in the evening by default, with the rollback ready.
  • One instance of the calculation per team, on our servers, monitored like the rest of the infrastructure.

The outcome

An in-house calculation engine in production, with results identical to the original tool. Several teams served within a few weeks, each with its own screens. Results identical to four decimal places on the reference sets. A continuous test bench every five minutes, with a cutover criterion written in advance. Sixteen automated tests on day one, sixty-four four days later. And three defects of the original tool identified and documented, without ever copying them.

Replacing business software is not a development project. It is a trust project. The code is only the means. What users adopt is a number they no longer need to check.

Further reading: an AI copilot for IT infrastructure, on how I work with my agents, and Veeam to PBS, the same discipline of proof applied to backups.