How to refactor 31,000 lines of bad code
basildoncoder.com
basildoncoder.com
It seems unit testing would be key, but it's problematic in that everything is private! Getting the bird's-eye view is an intriguing thought, but I'm wonder how to actually go about the refactoring itself?
I could avoid it, but it seems that I'm already hacking code that itself was a hack (cuz I didn't know what I was doing). It makes updating and extending a very time-consuming proposition.
I'm the author of that article. I actually have a blog post in the works that addresses your concerns fairly directly, since they are concerns for me too. Keep an eye out for it. In brief, I recommend you buy a copy of Working Effectively With Legacy Code immediately, then work to get unit tests in place. Make sure you have a couple of tests for each public interface in the system. Once you have rudimentary test coverage, it becomes easier to refactor things without worrying so much about breakage.
That is, the interface specifies a public method getIdentity() that returns an _identity_ object, but the class has getName(), getIDNumber(), that are public (so we can test them) but not declared in the interface? Do people do things like that?