Urgent.News

What's breaking now, across thousands of outlets.

Tech

Replacing a legacy system? Run the new code in its shadow first

Most rewrites of a working system fail the same way. The new code passes every test the team thought of, goes live, and then meets the rules nobody wrote down: the discount that only applies on the last day of the month, the customer whose IDs start with a zero, the rounding the old system did "wrong" for fifteen years that finance now depends on. You can't write tests for rules you don't know…

When replacing a legacy system, a common mistake is to assume the new code will work perfectly from the start. However, new code may fail in ways that weren't anticipated, such as unexpected rules or discrepancies in handling edge cases. To avoid this, run the new code alongside the old one using a technique known as "shadowing."

In shadowing, the new code runs in parallel with the existing system, processing the same inputs but not producing outputs that users see. Instead, the outputs of the new code are recorded and compared to those of the legacy system. Any differences are treated as either bugs in the new code or undocumented rules in the old system that need to be addressed. This approach ensures that users are not impacted by potential issues during the transition.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Filters and Probabilistic Searching - Part 1: Introduction

In my Data Structures and Algorithms in JavaScript book, we studied Dictionary implementations for exact searches. In this article series, we will explain what probabilistic searches are, when they…

  • Introduces probabilistic searches and filters for determining key presence.
  • Explains filters' purpose, benefits, and implementation in computer science.
  • Describes Bloom Filters as a specific implementation of filters.

More from Thursday 8 October →