Legacy Code is Fear
Legacy code is fear because we fear the unknown. Learn what you need to learn in order to be less scared about legacy code during this talk.
Introduction
This will be a presentation about how you can work fast and safe with existing code. I will present the problem of working with legacy code and some of the solutions I know.
You are a programmer. Someone from the company comes with an idea to add a feature and they are sure this new feature is very easy to add. And it should be. But the code is old. The code is a mess. Nobody in the firm knows any more that part of the system. You need to change that ugly piece of code. You are afraid that you might introduce defects. Legacy code is fear.
During this talk we will discuss a Mantra Against Fear that will consist of the attitude, the tools and the techniques you can use to work fast and safe with existing code. You will learn how you can apply agile software development to messy ugly code.
Target Audience
If you are working as a programmer, tester, technical manager or CTO this talk might be extremely helpful. If you are a manager, trainer, coach you will find out about some ideas that you could implement with the companies you work with.
Process Mechanics
A very clear image of the reason to change the legacy code is essential: fix a bug, add a feature, cover the core system part with tests.
I will explain why not reading legacy code is a lot better because even if we think we are super-smart programmers we never get what legacy code really does when we read it.
One alternate way programmers could understand legacy code is to focus on writing characterization tests. But these characterization tests should be focused on a very thin layer of behavior, we should cover the least amount of code needed for the stated purpose of the change.
Characterization tests can be of several type in the beginning: System Tests, Acceptance tests, Integration tests, Component tests, Contract tests, Unit tests. But we might need to refactor some of the higher order tests, on the tests pyramid, into unit tests.
I will focus why it is essential to go in small steps that seem very unnatural to us. Also the steps may vary depending on the programming language.
Agile Software development can be applied on legacy code if we focus on delivering the value, meaning doing the change needed, and if we let all the rest of the ugly code be the same. It is a challenge for any programmer to leave ugly code behind, but changing it would not bring any value for the moment.
Adrian Bolboaca Software Craftman, Mozaic Works
I try to be a continuous learner and a continuous teacher, because I think good software comes from the skills of the people that are involved in the process, on each and every level. Whenever I write code I focus on reducing domain complexity to obtain maintainable software. I love to develop software that helps companies to improve their business, to implement solutions that improve their internal processes and to motivate teams to use their capabilities to yet another level.