Justifying a rewrite
Fact is there is no way a rewrite is justifiable by any means to any business but there is a scenario where a rewrite, not a refactor, might be justifiable.
Is important to understand that the rewrite decision will not be taken by a software engineer, by a team lead or by a manager, it will be taken by the business owner. It is in fact the business owner decision because it is his (her) money that is on the line and with that said how do you justify a rewrite.
First understand how much a rewrite will cost:
- How many human resources will be for the rewrite?
- What tools will be required for the rewrite?
- How long will be rewrite will take?
- Why is the rewrite required ?
The first 2 questions will give you an idea of cost “guesstimate” and I mean “guesstimate”. Is true that you could multiply the the amount of developers times the time that will take to give a cost to a rewrite but this cost will never really reflect the true cost and will become a good guess.
So how to justify and estimate the true cost of a rewrite. Fact is there is no real math but you should be able to justify a rewrite by the amount of technical debt that the current application have.
Let me give you an example. The following scenario did happen and it was reported as a bug (defect that happens in production).
A client called stating that the report was showing a wrong deduction of $1.95 . Support recorded the complaint and send it to the business analyst to determine if it was a bug. Analysis was made and it was sent to QA to confirm and replicate the bug.
Let’s stop here. Up to this moment there are 3 human resources working on a possible bug and up to this moment it doesn't even account for the software engineer time.
In a “dumb math” you could consider the hourly salary of each of the human resources that worked on the complaint and the time that it took to be confirmed. If each person earns 100k per year and this complaint took about 10 hours to be confirmed, this means that we have 3 x 49 x 10 as the initial cost of this bug. That is $1470.00 just to get it confirmed. When you add the time of the software engineer on this to correct the bug, send to QA, re-test, ensure quality and deploy, this amount can double easily and it we are only talking about a bug.
Technical debt is one of the biggest reasons for a rewrite but it is not the only one. To justify based on technical debt a rewrite the technical debt must be bigger than the salary of everyone working on the project for the time being in the long run.
A rewrite will never be justifiable in the short term, it is the long term that will justify the investment. Whenever building a new product be sure that what is being done will not require a rewrite in 5 to 10 years span. Not saying that it wont require a refactor in this period, just a rewrite.
To help justifying a rewrite you can include:
- stronger foundation
- increase of quality
- ensurance that new features will be added with less time cost
A rewrite should be taken seriously. It requires an investment that is usually hidden to any software engineer and if you were able to justify a rewrite, do yourself a favor and make sure that it is a piece of craftsmanship.