A Legacy Code – is an existing product code, yet working, or a just finished one, which has to be in some way finalized. When a company has an application that requires additional functionality, or when the code is almost ready but the development team has not been able to complete it, it is time to update the legacy code.
Legacy Code updates criteria estimation
There are 4 Legacy Code Updates Scenarios possible:
- Legacy Code Update Impossible
This happens when a source code is poorly written, and cleaning it up is simply not worth it, or a request is unrealistic.
- Code Written From Scratch
Sometimes there is no need in using the previous code at all. The main advantage of this approach is that it ensures the clearness of the final product.
- Legacy Code Refactored
In such an approach, the developers work with a client’s base, adding new features step-by-step. This is only possible when a code’s structure is clear and logical and completely tested.
- Code Doesn’t Need Updating
In very rare cases, working with an old code base is possible.
What do Legacy Code updates depend on
It is important to understand how “old” the code is. Some code parts may have become too old for modern usage, so it is simpler to just rewrite it.
- Code architecture
Monolith or microservices? Can an application be divided into parts, and can those parts be updated separately? Usually the code refactoring is not possible in case it is not able to be divided.
- Test coverage
It determines whether the code is covered with tests enough or not; thus, if such tests should be written.
A team will check how the deployment is going when new code enters the old system.
Pre-code updating to-do list
- Agree on expectations. Make sure that a client and a team both comprehend all the application’s aims and objectives to achieve.
- Determine all the possible risks. Make sure the team determines all the possible changes in an application’s work.
- Provide great testing coverage. The specialists should decide what tests exactly they are going to execute. For instance, these can be unit or integration tests.