Edit: Assume that I will stay on this project until "the end".
The Problem
I'm currently working on a legacy interesting Java project(s). A full rewrite is currently out of the question, as I am working alone, and the current desired functionality was due months ago (before I came onto the project).
It is rather large, and includes:
- JDK 1.5
- Essentially 0% test coverage
- 7 separate Java projects that contain a very circular build
- Ant and Maven (which I want to upgrade into Gradle)
- A Java Webstart GUI app
- Drools 5.5 (manages almost all important functionality)
- 3 Apache Tomcat servers (running Apache Axis, which was last updated in 2006)
- and many other deprecated libraries that... do things
I have gotten it compiling and running correctly in a new development environment, and have upgraded the JDK off of 1.5 and have started using 1.6/1.7/1.8 where I can. I have also updated Drools to 5.6. I have just barely gotten the project to a point where it is possible to make changes and verify it in a somewhat sane manner while having it run in a non-deprecated env. However, there are many areas of the code where large chunks have been copy pasted into the other projects, and have since been maintained differently. I am largely unsure of what anything does - outside of the "main flow".
What the @!#$? did I get myself into?
What I want, is to refactor this thing in a way that makes sense, but doesn't take me too long. I was thinking of just ripping all the types and whatever that functionality are making it circular out into a separate "SharedJunk" project?
But, what I need, is to get new functionality, and it was asked for yesterday.
Do I just slam my face into churning out more of the same quality of work that has led this project into this near-unmaintainable-death-state? Or do I refactor? There is an infinite amount of cleaning to do.
My boss is very patient, and wants this "done the right way", however, he is fighting off pressure from other areas of the company and I feel he might not hold out forever.
The options
- Refactor forever
- Refactor the bare minimum
- Slam my face into banging out new code
- Cry
Any general advice on what to do on this sort of project would be greatly appreciated. I am currently rereading through Working Effectively With Legacy Code and Refactoring to Patterns. I can clarify this, but I am unsure what to add.
Thank you.