Proving a rewritten service behaves like the old one 2 questions in 2 chapters
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 answer1.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
- Medium: Java to Go: How we cut memory 40x in 48 days without changing behaviour (Nov 2026)
- GitHub Scientist: a Ruby library for carefully refactoring critical paths
- Martin Fowler: Strangler Fig Application
- PIT mutation testing for Java
- Oracle JDK 21 documentation: The java command
- OpenJDK JEP 346: Promptly Return Unused Committed Memory from G1
- Oracle JDK 21 documentation: Native Memory Tracking
- GraalVM documentation: Native Image