About to embark on the initial phases of a project to rewrite a legacy application from the ground up (existing business rules will change somewhat, and be extended to incorporate a large number of new requirements that the existing infrastructure cannot handle). I am looking for items that are important to remember when working to reengineer an existing application.
|
|
Write a suite of unit tests for the existing functionality first. When you do your rewrite, you can use this unit test suite to verify that your existing business rules still work in the new application. |
|||
|
|
|
Come up with an incremental transition plan. That is, make it so the project is always in a runnable state, transitioning from old code to new code without getting in the position of requiring effectively all of the new code to be written first before anything works. There might be some things still done "the old way," while other features are done "the new way," and the user interface might be less than desirable for a while. But this approach will significantly reduce your risk, because you can always ship something. (Actually, if you have a gradual UI transition too, this might work nicely with Joel's notion of the Iceberg Effect: management/customers will see progress and have a notion of what remains to be done.) This depends somewhat on the circumstances of your code base, but look carefully before deciding if this base is the exception to the rule or not, because it probably isn't. |
|||
|
|
|
|||
|
|
|
Trying to come up with things not already said:
|
|||||||||
|
I really wanted to leave it at those three steps, but just in case someone took it as me being lazy, rewriting from scratch is almost doomed to fail. Incrementally adapting and refactoring code is the best way. |
|||||||
|
|
Lots of good answers so far. (I assume the existing system is either a hopeless jumble or coded on the wrong platform) Here are my thoughts:
|
|||
|
|
|
One big thing to remember when rebuilding from scratch is domain knowledge. Companies often engage in 'complete rewrites' - using the most recent technologies and development projects to ensure the highest order of buzzword compliance - leading to dissappointing results because the people who knew most about the topic were not consulted with extensively. There's nothing wrong with complete re-writes. Or mostly complete rewrites. There's a time and a place for them. Platforms change, technologies change... sometimes they just have to be done. But, they are best done under the guidance of the people who are the most expert at the topic - those involved in the previous implementation - for the best chances of a positive outcome. |
|||
|
|
|
There are a lot of good answers here that are really good points. There is one thing that I think is also important. Look at how technology has progressed from the point where the original code was written and what is out there now: By all means, you must assess the existing code; unit test, plan, research, development, more testing. But you also have to take into consideration new technologies that may extend the lifetime of version 2. |
|||
|
|