I have taken over about 150,000 lines of code for a test-rig control and data-logging application. There are functions of several hundred lines, global variables everywhere, no automated tests and almost no documentation. I have to fix bugs and add features, and each change I make seems to break something unrelated.
A rewrite is tempting but I doubt I would be given the time. What is a sound technical approach to getting code like this under control step by step?




