Legacy Code : RehabA Workshop with @johnnonolanFriday, 26 April 13
• Spent a few years thinking about rewrites.• Not an expert/guru.• Written a load of crap.MeFriday, 26 April 13
What is legacy?• Code without tests?• Old tech?• Not the latest thing?• Not invented here?Friday, 26 April 13
Is legacy so bad?Outside of software, how do we see legacy?Friday, 26 April 13
Theres no getting away withit	Legacy is everywhereFriday, 26 April 13
2 choicesRebuild or RenovatePhoto by John T PilotFriday, 26 April 13
• Estimates always wrong.• New bugs.• Secret knowledge in the code.• Lengthy code freeze.• Organisation needs to wait for ...
But Renovating?• The code is a mess.• You dont know where to start.• It has become poorly designed.• It is typically untes...
Botch it then?• Just hack the change in.• Code will be worse.• Which leads to worse code.Friday, 26 April 13
Right lets do it!• Scratch refactor• Tell the story of the system• Sketches• Characterization tests• Golden Master techniq...
Code SampleTrivia Code basehttps://github.com/jbrains/triviaFriday, 26 April 13
Scratch refactor	• Start playing with the code.• Throw away the changes.Friday, 26 April 13
Telling the story?• Just the essentials• Then move on to more granular bits• Rinse & repeat.Friday, 26 April 13
Sketches• Feature sketches• Effect Sketches• Effect analysisFriday, 26 April 13
Characterization tests• Fail• Pass• Sensing variables• Inheritance• change access modifier• Throwaway?Friday, 26 April 13
New FeatureFriday, 26 April 13
Thanks• This session is all about understanding the impact ofchange.• Small safe steps.• Vices.Friday, 26 April 13
FeedbackEmail : johnnonolan@gmail.comTwitter: @johnnonolanFriday, 26 April 13
Upcoming SlideShare
Loading in …5
×

Legacy code rehab

325 views

Published on

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

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

No notes for slide

Legacy code rehab

  1. 1. Legacy Code : RehabA Workshop with @johnnonolanFriday, 26 April 13
  2. 2. • Spent a few years thinking about rewrites.• Not an expert/guru.• Written a load of crap.MeFriday, 26 April 13
  3. 3. What is legacy?• Code without tests?• Old tech?• Not the latest thing?• Not invented here?Friday, 26 April 13
  4. 4. Is legacy so bad?Outside of software, how do we see legacy?Friday, 26 April 13
  5. 5. Theres no getting away withit Legacy is everywhereFriday, 26 April 13
  6. 6. 2 choicesRebuild or RenovatePhoto by John T PilotFriday, 26 April 13
  7. 7. • Estimates always wrong.• New bugs.• Secret knowledge in the code.• Lengthy code freeze.• Organisation needs to wait for new features.Risks of Re-buildingFriday, 26 April 13
  8. 8. But Renovating?• The code is a mess.• You dont know where to start.• It has become poorly designed.• It is typically untested.Friday, 26 April 13
  9. 9. Botch it then?• Just hack the change in.• Code will be worse.• Which leads to worse code.Friday, 26 April 13
  10. 10. Right lets do it!• Scratch refactor• Tell the story of the system• Sketches• Characterization tests• Golden Master techniqueFriday, 26 April 13
  11. 11. Code SampleTrivia Code basehttps://github.com/jbrains/triviaFriday, 26 April 13
  12. 12. Scratch refactor • Start playing with the code.• Throw away the changes.Friday, 26 April 13
  13. 13. Telling the story?• Just the essentials• Then move on to more granular bits• Rinse & repeat.Friday, 26 April 13
  14. 14. Sketches• Feature sketches• Effect Sketches• Effect analysisFriday, 26 April 13
  15. 15. Characterization tests• Fail• Pass• Sensing variables• Inheritance• change access modifier• Throwaway?Friday, 26 April 13
  16. 16. New FeatureFriday, 26 April 13
  17. 17. Thanks• This session is all about understanding the impact ofchange.• Small safe steps.• Vices.Friday, 26 April 13
  18. 18. FeedbackEmail : johnnonolan@gmail.comTwitter: @johnnonolanFriday, 26 April 13

×