I had many clients that want to follow Agile practices in order to improve the velocity of their team. Velocity means for them to fix bugs in production or solve emergencies got in Legacy systems.
My approach to that have been the same, if your company has a huge Technical debt you have to work as firemen. However, if you focus on reducing your technical debt or eliminate it in the best cases you can put your effort to new projects or innovate.
Methods to attack the Technical Debt
The best method to improve the quality of your code is Refactoring but if you have a Legacy so you have to create unit test to cover each functionality of your source code and if you have the knowledge to automate test, it would be better. Then you have to run your suite of test cases to validate your source code.
Apart from the fact of refactoring, unit test ensure:
- The code meets expectations and specifications: Does what it says it should do?
- The code continues to meet expectations over time: Avoiding regression
A unit test is the evidence of developers have done well your job.
One important concept is the unit test coverage.
Unit Test Coverage
The question with the coverage is how much is enough?
Effective tests should account not only for code paths, but also input values and other application state or external environment that may affect the behavior.
While it’s a worthwhile goal to try to get high code coverage in your unit-testing, a score of 100% doesn’t guarantee that you’ve tested enough.
A good way to reduce bugs is to automate test cases in order to rerun the test cases before releasing a new version. There are many open source tools such as Selenium and others where you have to pay license as Quick Test Pro (regression test) and Load Runner (stress and performance test).
Last but not least, there is a huge challenge with some managers who don’t want to change source code because is too risky. If you can’t convince them you have to show what is the impact to keep the old source code with metrics. In addition, refactoring forever so you will improve always the quality of your code!!!