Talk that introduces useful techniques to bring agility into a legacy codebase. Covers code smells, design smells, architectural smells, and deployment smells. Examples are representative of typical Java legacy projects. Includes refactoring screencasts.
Presented at GIDS.Java 2015 in Bangalore, India.
8. Legacy Code
The phrase strikes disgust…
Murky swamp of tangled
undergrowth with leeches beneath
and stinging flies above…
Not enough to try to prevent the
rot – you have to be able to reverse
it.
Robert C Martin
78. Mission Learnings
Do not forget strategy!
1. Identify change points
2. Find test points
3. Break dependencies
4. Write tests
5. Make changes and refactor
79. But there is more…
Cod e Smells
Des ign
Smells
Arch itectu re
Smells
Dep lo
y-
ment
Smells
80. • Long methods
• Long class
• Temporal coupling
• Fields as temporary variables
• Out parameters
• Setters
• many more…
Cod e Smells
Des ign
Smells
97. • Branching based on release / feature / team
• Dependencies not version controlled
• Database changes not version controlled
• Deployment scripts not version controlled
• Shared non-isolated environments
• Infrastructure access highly restricted
Arc h itec tu re
Smells
Deployment
Smells
100. Arc h itec tu re
Smells
Deployment
Smells
Versioned Change Tracking
101.
102.
103.
104. “Systems that gradually degrade
are systems that can gradually
improve.”
Cod e Smells
Des ign
Smells
Arch itectu re
Smells
Dep lo
y-
ment
Smells
Robert C Martin