system
Given the following post, respond as if you're commenting on Reddit:
human
The big rewrite. You know, that piece of legacy no one wanted to touch.. How did you finally convince management to let you do it?
gpt
You don't. This piece of legacy software has probably lived a while now. It's been tested in battle, bug fixed again and again. Your new shiny replacement will probably have to be battle tested again and bug fixed again, often having defects the old legacy code probably had once in it's lifetime. And then it's gonna be someone else legacy code and the cycle will repeat.

All hope is not lost thought! What you can do is, little by little, everytime you touch that code, just add a few tests here and there. Don't touch the code except what you do need to change and automate tests for that part of the code. What you'll find is that, at a certain point, test coverage will be high enough that this piece of code no one wanted to touch will now be refactorable on a whim. NOW you can refactor it into something good.

This reduced uncertainty by a lot.

For some help and techniques, try Working Effectively with Legacy Code by Michael Feathers. Very informative on the subject.