Proving a rewritten service behaves like the old one 2 questions in 2 chapters

  1. 01Migrations and rewrites
  2. 02Sources

Migrations and rewrites

  • 1.1 You are porting a production service to a new language. How do you prove the new one behaves exactly like the old one? Hard 5 min

    I'd treat it as an equivalence project, not a rewrite. The running old service is the reference, not its test suite. I write down what "equal" means before writing comparison code, replay the same real requests against both, and compare the response, the database rows, the messages, and even the SQL sequence. Then I prove the comparison can actually fail, with mutation testing and fault injection.

    Read the full answer
  • 1.2 A team says moving a service from Java to Go cut memory 40 times. Is that a fair Java-versus-Go comparison? Medium 4 min

    Not by itself. The number is real but the baseline matters: JVM heap settings, GC choice, framework, and whether they measured heap or container RSS. In that write-up, memory at rest fell from 494 Mi to 12 Mi, but peak only from 558 Mi to 78 Mi, about 7 times, and infrastructure was removed at the same time. Before rewriting, I'd tune the JVM and measure RSS, then decide.

    Read the full answer

Sources