Testing in Legacy: from Rags to Riches by Taras Slipets
-
Upload
javadayua -
Category
Technology
-
view
184 -
download
1
Transcript of Testing in Legacy: from Rags to Riches by Taras Slipets
3
About me
{ “First name”: “Taras”, “Last name”: “Slipets”, “E-mail”: “[email protected]”, “LinkedIn Profile”: “http://www.linkedin.com/ pub/taras-slipets/ 48/466/516”, “Interests”: [ “Software Engineering”, “Music”, “Skiing”, ]}
5
About presentation
• General feeling about legacy
• System that we’ve received for improvement
• Effective steps that were performed
• What we’ve eventually reached
10
Where do we go now
• General feeling about legacy
• System that we’ve received for improvement
• Effective steps that were performed
• What we’ve eventually reached
11
What we’ve received
• 11-years old system SUCCESSFULLY running on production servers• Written in Java 1.4• No frameworks usage• No documentation• No developers who has worked on it• Impatient customers• Pantient management• other surprises…
14
What we’d like to have?
Shiny system with all cutting-edge frameworks
Reduce pain of maintenance and support
15
What we’d like to have?
Shiny system with all cutting-edge frameworks
Reduce pain of maintenance and support
16
Where do we go now
• General feeling about legacy
• System that we’ve received for improvement
• Effective steps that were performed
• What we’ve eventually reached
18
Setup your environmentLet’s deployour changes!
Great! Wheredo we go?
Directly to production!
“To production!”he said…
39
Top occurring issues
• “do-stuff” methods• “I’m aware of everything” classes• “Celebrities” classes/interfaces• “Magic goes here” blocks without comments• Just obsolete code
43
Refactoring facilities• Extract method• Extract interface• Parameter object• Method object• Replace type-checking code with
State/Strategy• Move method/field• …
50
Most used in our case
• Template method• Strategy• State• Visitor• Command• Chain of Responsibility• Observer
66
Where do we go now
• General feeling about legacy
• System that we’ve received for improvement
• Effective steps that were performed
• What we’ve eventually reached
72
Lessons learned
• Old project is not a disaster, but challenge• Start from environment setup and feature testing. At least to
some extent• Share knowledge with your colleagues and write docs• Do not underestimate power of classical remedies (patterns,
working techniques)• Be agile ;)
73
Links
• http://www.amazon.com/Working-Effectively-Legacy-Michael-Feathers/dp/0131177052
• http://xpdays.com.ua/archive/xp-days-ukraine-2011/materials/legacy/
• http://xpdays.com.ua/archive/xp-days-ukraine-2012/materials/code-story/
• http://jeeconf.com/archive/materials-2014/legacy-projects/• http://jeeconf.com/materials/web-application-i-have-always-drea
mt-of/