Victor Chircu - Silviu Eigel - Clean Legacy Code - CodeCamp 10 may 2014

347 views

Published on

Victor Chircu - Silviu Eigel - Clean Legacy Code - CodeCamp 10 may 2014

Published in: Software
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
347
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Victor Chircu - Silviu Eigel - Clean Legacy Code - CodeCamp 10 may 2014

  1. 1. Clean Legacy Code Victor Chircu @Yonder Silviu Eigel @Ness 10th of May 2014
  2. 2. Legacy Code “Source code inherited from someone else and source code inherited from an older version of the software” Wikipedia
  3. 3. Legacy Code “Code without tests” Michael Feathers
  4. 4. So What?
  5. 5. Refactoring “A controlled technique for improving the design of an existing code base, without changing external behavior” Martin Fowler
  6. 6. Refactoring Refactoring requires unit tests Especially refactoring legacy code
  7. 7. Daily Standup Yesterday I’ve… Today I’ll fix a bug inside BookOverview page Nothing is blocking me
  8. 8. What Is BookOverview Page
  9. 9. Demo
  10. 10. Cleaning Legacy Code
  11. 11. Cleaning Legacy Code Algorithm 1. Identify change points. 2. Find test points. 3. Break dependencies. 4. Write tests. 5. Make changes and refactor.
  12. 12. Dependency Breaking Techniques Extract method under test Parameterize method Break encapsulation Extract and override call Subclass and override method
  13. 13. Refactorings Extract Method, Inline Method, Inline Temp, Move Method, Extract Class, Self Encapsulate Field, Consolidate Duplicate Conditional Fragments, Replace Nested Conditional With Guard Clauses, Invert Conditional, Replace If With Switch, Rename Method, Change Signature, Add Parameter, Remove Parameter, Separate Query From Modifier, Pull Up Field, Pull Up Method, Extract Interface, Replace Constructor With Factory Method
  14. 14. Our Legacy Github Repo: http://tinyurl.com/CleanLegacyCode Stay tuned: iasidevelopers.net
  15. 15. Q&A
  16. 16. Clean Legacy Code Victor Chircu @Yonder Silviu Eigel @Ness 10th of May 2014 Please fill in your evaluation form

×