Download - Working with legacy code
![Page 1: Working with legacy code](https://reader035.vdocuments.net/reader035/viewer/2022062418/5564649fd8b42a951e8b5217/html5/thumbnails/1.jpg)
Working with legacy codeGUNNAR PEIPMAN, ASP.NET/IIS MVP
![Page 2: Working with legacy code](https://reader035.vdocuments.net/reader035/viewer/2022062418/5564649fd8b42a951e8b5217/html5/thumbnails/2.jpg)
About me
Name: Gunnar Peipman
Job: Chief Everything Officer
Company: Peipman Consult Ltd
Hobbies: Coding, reading, travelling, beers
In family: boyfriend, step father and father
Animals: white fluffy bunny
Me & MS: ASP.NET/IIS MVP, blogger, speaker
Community: ENETA (www.eneta.ee)
http://weblogs.asp.net/gunnarpeipman/
E-mail: [email protected]
![Page 3: Working with legacy code](https://reader035.vdocuments.net/reader035/viewer/2022062418/5564649fd8b42a951e8b5217/html5/thumbnails/3.jpg)
Agenda
What is legacy code and where it comes from?
How to fight back?
Tools and techniques
Examples
Questions and answers
![Page 4: Working with legacy code](https://reader035.vdocuments.net/reader035/viewer/2022062418/5564649fd8b42a951e8b5217/html5/thumbnails/4.jpg)
Essentials of legacy code
![Page 5: Working with legacy code](https://reader035.vdocuments.net/reader035/viewer/2022062418/5564649fd8b42a951e8b5217/html5/thumbnails/5.jpg)
What is legacy code?
The code we already released to users
Code covered with no tests
Messy code
![Page 6: Working with legacy code](https://reader035.vdocuments.net/reader035/viewer/2022062418/5564649fd8b42a951e8b5217/html5/thumbnails/6.jpg)
LEGACY CODE
messy
confusingbad dependencies
hard to read spaghetti
untestable
ugly
don‘t touch it
in production
undocumented
tricky
problematic
just works
![Page 7: Working with legacy code](https://reader035.vdocuments.net/reader035/viewer/2022062418/5564649fd8b42a951e8b5217/html5/thumbnails/7.jpg)
Where legacy code comes from?
Death march projects Unskilled developers Impossible dead-lines Bleeding-edge technologies Complex technologies Silver-bullet tools Digital slavery
![Page 8: Working with legacy code](https://reader035.vdocuments.net/reader035/viewer/2022062418/5564649fd8b42a951e8b5217/html5/thumbnails/8.jpg)
Dynamics of legacy code
All problems happen every day with small steps under our own eyes
![Page 9: Working with legacy code](https://reader035.vdocuments.net/reader035/viewer/2022062418/5564649fd8b42a951e8b5217/html5/thumbnails/9.jpg)
War plan
![Page 10: Working with legacy code](https://reader035.vdocuments.net/reader035/viewer/2022062418/5564649fd8b42a951e8b5217/html5/thumbnails/10.jpg)
How to fight back?
Write readable code
Write testable code
Refactor
Avoid hacks
Look how others have solved similar problems
Study different patterns
Improve your coding skills
If you find mess then clean it up
![Page 11: Working with legacy code](https://reader035.vdocuments.net/reader035/viewer/2022062418/5564649fd8b42a951e8b5217/html5/thumbnails/11.jpg)
Process for single developers
Find mess
Investigate
RefactorRedesign
Validate
![Page 12: Working with legacy code](https://reader035.vdocuments.net/reader035/viewer/2022062418/5564649fd8b42a951e8b5217/html5/thumbnails/12.jpg)
Process for teams
Code review
Detect problems
Agree on solutions
Redesign code
Validate
![Page 13: Working with legacy code](https://reader035.vdocuments.net/reader035/viewer/2022062418/5564649fd8b42a951e8b5217/html5/thumbnails/13.jpg)
Winning the battle
![Page 14: Working with legacy code](https://reader035.vdocuments.net/reader035/viewer/2022062418/5564649fd8b42a951e8b5217/html5/thumbnails/14.jpg)
Refactoring
Refactoring - making changes that doesn’t change code functionality
Different tools provided by IDE-s
![Page 15: Working with legacy code](https://reader035.vdocuments.net/reader035/viewer/2022062418/5564649fd8b42a951e8b5217/html5/thumbnails/15.jpg)
Patterns
Design patterns
Unit testing patterns
Analysis patterns
Enterprise applications architecture patterns
Enterprise integration patterns
SOA patterns
Universal data models
![Page 16: Working with legacy code](https://reader035.vdocuments.net/reader035/viewer/2022062418/5564649fd8b42a951e8b5217/html5/thumbnails/16.jpg)
Testing
Unit tests
Integration tests
Stress tests
Performance tests
User Interface tests
Database tests
Acceptance tests
Tracer bullet tests
![Page 17: Working with legacy code](https://reader035.vdocuments.net/reader035/viewer/2022062418/5564649fd8b42a951e8b5217/html5/thumbnails/17.jpg)
Quality assurance
Automated and manual testing
Code reviews
Paired programming
Set up goals for developers
![Page 18: Working with legacy code](https://reader035.vdocuments.net/reader035/viewer/2022062418/5564649fd8b42a951e8b5217/html5/thumbnails/18.jpg)
Examples
![Page 19: Working with legacy code](https://reader035.vdocuments.net/reader035/viewer/2022062418/5564649fd8b42a951e8b5217/html5/thumbnails/19.jpg)
Thank you!
![Page 20: Working with legacy code](https://reader035.vdocuments.net/reader035/viewer/2022062418/5564649fd8b42a951e8b5217/html5/thumbnails/20.jpg)
Q&A