Shadow Testing a Legacy App When There's No API to Shadow
by DeeDee Walsh, on Nov 30, 2026, 6:35:19 PM
Anthropic checked its Python-to-Rust rewrite by comparing the old and new systems on real traffic. Here's how to apply the same idea to a VB6, PowerBuilder or Access application.
In late October, Katelyn Lesse, who runs platform engineering at Anthropic, described on the Latent Space podcast how her team rebuilt the Messages API, the endpoint behind every Claude API call, moving it from a Python monolith to Rust. Claude wrote most of the code, and the team started with no Rust developers. Here's Anthropic's own write-up.
For anyone running a modernization program, the interesting part is how they checked the work. They mirrored production requests to the Rust system, compared its responses with the Python system's, and moved real traffic over as the comparisons held up. The old system served as the specification. Nobody tried to write down what the API was supposed to do and test against that document.
That approach fits legacy work even better. In a 25-year-old codebase, the documentation describes what someone intended in 2003. The running binary is the only accurate record of what the system does today.
Anthropic did have advantages most legacy teams don't. A web API takes structured requests and returns structured responses across a network boundary, so you can copy traffic to a second system and compare outputs. A VB6, PowerBuilder or Access application usually has none of that. The business rules, the UI and the SQL often sit together in one event handler like btnSave_Click(), with On Error Resume Next at the top. There's no traffic to mirror, and some of the state lives in a hidden TextBox on a modal form.
|
Web API (Python to Rust) |
Legacy desktop app (VB6 / PB / Access to .NET) |
|
|
Inputs |
HTTP requests |
Clicks, keystrokes, modal dialogs, global variables |
|
What you compare |
Response payloads |
Database rows, flat files, printed reports |
|
State |
Mostly per request |
Shared session state, temp tables, hidden controls |
|
Hardest part |
Latency, streaming, serialization edge cases |
Working out what the app actually did to the database |
You don't need to wait until the legacy app looks like a service before you start. You need to change where you compare.
1. Compare at the database, not the UI
The common instinct is to refactor the legacy app first so it exposes a clean interface to test against. Skip that. Refactoring a fragile application in preparation for replacing it adds months and new risk before you've replaced anything.
You already have a structured boundary: the database. Whatever happens in the forms, the application's job is to change rows in SQL Server, Oracle or a Jet/ACE file, and sometimes to produce a CSV, an EDI file or a printed invoice. Compare those.
Snapshot and diff. Restore a known database snapshot. Run a business workflow through the legacy app and capture what changed. Restore the same snapshot, run the same workflow through the new .NET build, and compare the two end states.
What to compare. Every inserted, updated and deleted row in the tables in scope, side effects from stored procedures and triggers, and generated files (parsed or hashed).
Pin the environment. Legacy apps read a lot of context that isn't visible in the code. Fix the system date, Windows regional settings, INI files and relevant registry keys before each run, on both sides. If the VB6 app parses "03/04/2026" under one locale and the new app runs under another, you'll get differences that have nothing to do with the migration.
Filter noise before the first run. A raw database diff will flag hundreds of differences that don't matter. Build a normalization step first:
- Match rows by business key (InvoiceNumber plus line number), not identity columns or generated GUIDs.
- Ignore CreatedAt/ModifiedAt timestamps and session audit columns.
- Compare numbers as values, not as formatted strings.
If 399 of 400 flagged differences are timestamps, engineers will stop reading the report within a week. Every line in the output should be worth someone's attention.
2. Feed both systems the same inputs
The next question is how to drive a 1999 PowerBuilder client and a new .NET web app with identical inputs without a room full of testers. Split the work into two tiers.
Tier 1: Golden datasets for calculation logic. In most migrations, the expensive defects are in pricing, tax, rating and batch jobs, not in the CRUD screens. Take a sanitized slice of historical production data, such as last quarter's invoices or claims. Run it through the legacy code, calling batch entry points or COM components directly where you can, and save the results as your baseline. Run the same inputs through the migrated .NET code and compare. This covers much of the financial risk without touching the UI, and it's usually the quickest test to stand up.
Tier 2: Workflow replay for stateful screens. Some logic only runs inside form events or DataWindow buffers. Don't try to automate every admin screen. Pick the journeys that carry revenue or compliance risk, such as order entry, claims adjudication and inventory adjustments. Record or reconstruct the input sequences, run them through both applications, and compare the database state at the end. A grid that renders a little differently doesn't matter. An OrderTotal that's four cents off does.
3. Sort every difference
Once the harness is running, expect a long list of differences at first. Each one belongs in one of three groups.
Regression. The new code is wrong. Fix it.
Intentional change. The old app truncated names at 50 characters, mangled Unicode, or used a two-digit year window. The new app shouldn't copy that. Update the baseline and record why.
Behavior something else depends on. This group causes cutover incidents. Some quirks have been in place so long that other systems, reports or people now expect them. Typical examples:
- Rounding. VB6's
Round()uses banker's rounding (half to even), whileFormat()and SQL Server'sROUND()round half away from zero, so one VB6 app can use both. .NET'sMath.Rounddefaults to banker's rounding, so a straight port can match the original in one calculation and drift in another, depending on which path the old code took. - Nulls in Access.
5 + Nullreturns Null, and"A" + Nullreturns Null while"A" & Nullreturns "A". Logic built on that, with anNz()fallback somewhere else, is easy to get subtly wrong. - Compensating processes. A PowerBuilder discount loop is off by one, and finance has had an Excel macro correcting for it since 2004. Fix the loop and the macro now over-corrects, and month-end close comes out wrong.
Correcting these during the migration gives you code that's right in isolation and breaks something downstream. The harness won't make these calls for you. It shows exactly which behaviors changed, so people who know the business can decide each one. Keep a record of every decision and who made it.
4. Where AI agents help, and where to watch them
Asking an agent to "rewrite this VB6 app in C#" gets you tidy C# that doesn't behave like the original. Agents are far more useful inside the verification loop.
Building the harness. Snapshot scripts, diff queries, normalization rules and seed data are tedious and tend to get postponed. Agents handle this work well.
Tracing a difference to its cause. When the harness shows NetAmount at $142.18 in the legacy database and $142.19 from .NET, an agent can follow that row back through frmInvoice.frm or n_cst_pricing.sru, compare it with the migrated C# method, and point to the line where the two diverge. That can save an engineer hours of reading.
Working through the backlog. With the harness as the pass/fail check, agents can fix, rerun and recheck hundreds of edge cases, and the 300th gets the same attention as the first.
Two failure modes to watch for:
Conflicting or dead code. If a module has three tax paths and a flag in a config table decides which one runs, an agent reading the source may pick the wrong one and state its answer with full confidence. Check its conclusions against what the harness shows the running app actually does.
Quietly fixing quirks. Models learn mostly from clean, modern code and tend to tidy up anything that looks wrong. Unless the harness enforces parity and every behavior change needs a named person's sign-off, an agent will eventually correct a quirk the business depends on.
Proof is the hard part
Generating C# from VB6 stopped being the bottleneck a while ago. The hard part is being able to tell a CFO before cutover that billing, inventory and compliance reports will come out the same on Monday as they did on Friday.
What Anthropic described is a team showing that the Rust system behaved like the Python one before trusting it with traffic. A legacy desktop app is harder to instrument than a web API, but the order of work is the same: build the comparison harness first, treat the running application as the spec, and put agents to work on the differences it finds.
Modernizing code from VB6, PowerBuilder, Access and other old stuff is a big challenge; much harder than from a modern language or framework like Rust or Python. This is what we spend our days (and nights!) working on.



