SlideShare uma empresa Scribd logo
1 de 18
Baixar para ler offline
L egacy Cod e : Rehab
                          lan
A Workshop with @johnnono
Me

● Spent a few years thinking about rewrites.
● Not an expert/guru.
● Written a load of crap.
What is legacy?

●   Code without tests?
●   Old tech?
●   Not the latest thing?
●   Not invented here?
Is lega cy so bad?

Outside of software, how do we see legacy?
getting aw ay with it
Theres no



       Legacy is everywhere
2 choices




                      Photo by John T Pilot

Rebuild or Renovate
Risks of R e-building

●   Estimates always wrong.
●   New bugs.
●   Secret knowledge in the code.
●   Lengthy code freeze.
●   Organisation needs to wait for new
    features.
But Renovating?

●   The code is a mess.
●   You don't know where to start.
●   It has become poorly designed.
●   It is typically untested.
Bot ch it then?

● Just hack the change in.
● Code will be worse.
● Which leads to worse code.
Right let's do it!

●   Scratch refactor
●   Tell the story of the system
●   Sketches
●   Characterization tests
Cod e Sample

Trivia Code base
https://github.com/jbrains/trivia
Scratch refactor

● Start playing with the code.
● Throw away the changes.
Telling the story?

● Just the essentials
● Then move on to more granular bits
● Rinse & repeat.
Sketches

● Feature sketches
● Effect Sketches
● Effect analysis
C haracteriz ation tests

●   Fail
●   Pass
●   Sensing variables
●   Inheritance
●   change access modifier
●   Throwaway?
New Feature
Thanks

● This session is all about understanding the
  impact of change.
● Small safe steps.
● Vices.
Feedback

  Email : johnnonolan@gmail.com
      Twitter: @johnnonolan

Mais conteúdo relacionado

Destaque (6)

The Pomodoro Technique
The Pomodoro TechniqueThe Pomodoro Technique
The Pomodoro Technique
 
Exploring bdd
Exploring bddExploring bdd
Exploring bdd
 
Why you need more documentation
Why you need more documentationWhy you need more documentation
Why you need more documentation
 
Legacy code rehab
Legacy code rehabLegacy code rehab
Legacy code rehab
 
Agile retros
Agile retrosAgile retros
Agile retros
 
Icebreakers and games for training and workshops - My website moved now to Bo...
Icebreakers and games for training and workshops - My website moved now to Bo...Icebreakers and games for training and workshops - My website moved now to Bo...
Icebreakers and games for training and workshops - My website moved now to Bo...
 

Semelhante a Legacy code rehab.

Coding Dojo: Fun with Tic-Tac-Toe (2014)
Coding Dojo: Fun with Tic-Tac-Toe (2014)Coding Dojo: Fun with Tic-Tac-Toe (2014)
Coding Dojo: Fun with Tic-Tac-Toe (2014)
Peter Kofler
 
Idiomatic R for Rosetta Code (2013)
Idiomatic R for Rosetta Code (2013)Idiomatic R for Rosetta Code (2013)
Idiomatic R for Rosetta Code (2013)
Peter Kofler
 
Product development and tools
Product development and toolsProduct development and tools
Product development and tools
roelofr
 
Pair Programming (2014)
Pair Programming (2014)Pair Programming (2014)
Pair Programming (2014)
Peter Kofler
 

Semelhante a Legacy code rehab. (20)

Introduction to Continuous Delivery
Introduction to Continuous DeliveryIntroduction to Continuous Delivery
Introduction to Continuous Delivery
 
Working With Legacy Code
Working With Legacy CodeWorking With Legacy Code
Working With Legacy Code
 
Agileee 2012
Agileee 2012Agileee 2012
Agileee 2012
 
Coding Dojo: Fun with Tic-Tac-Toe (2014)
Coding Dojo: Fun with Tic-Tac-Toe (2014)Coding Dojo: Fun with Tic-Tac-Toe (2014)
Coding Dojo: Fun with Tic-Tac-Toe (2014)
 
Pair Programming (2015)
Pair Programming (2015)Pair Programming (2015)
Pair Programming (2015)
 
Coding Dojo - Golden Master Technique - Approval Tests - Gilded Rose Kata-
Coding Dojo - Golden Master Technique - Approval Tests - Gilded Rose Kata-Coding Dojo - Golden Master Technique - Approval Tests - Gilded Rose Kata-
Coding Dojo - Golden Master Technique - Approval Tests - Gilded Rose Kata-
 
Agile Programming Live - AgilePrague2012
Agile Programming Live - AgilePrague2012Agile Programming Live - AgilePrague2012
Agile Programming Live - AgilePrague2012
 
React, Electron & Braaains - Magikcraft.io Project Update
React, Electron & Braaains - Magikcraft.io Project UpdateReact, Electron & Braaains - Magikcraft.io Project Update
React, Electron & Braaains - Magikcraft.io Project Update
 
Container Patching: Cloud Native Security Con 2023
Container Patching: Cloud Native Security Con 2023Container Patching: Cloud Native Security Con 2023
Container Patching: Cloud Native Security Con 2023
 
WeActuallyBuildStuff - Extreme Programming Live
WeActuallyBuildStuff - Extreme Programming LiveWeActuallyBuildStuff - Extreme Programming Live
WeActuallyBuildStuff - Extreme Programming Live
 
Come and Play! with Java EE 7
Come and Play! with Java EE 7Come and Play! with Java EE 7
Come and Play! with Java EE 7
 
Killer Bugs From Outer Space
Killer Bugs From Outer SpaceKiller Bugs From Outer Space
Killer Bugs From Outer Space
 
How to quickly add a safety net to a legacy codebase
How to quickly add a safety net to a legacy codebaseHow to quickly add a safety net to a legacy codebase
How to quickly add a safety net to a legacy codebase
 
Gamedev-grade debugging
Gamedev-grade debuggingGamedev-grade debugging
Gamedev-grade debugging
 
Bethesda's Iterative Level Design Process for Skyrim and Fallout 3
Bethesda's Iterative Level Design Process for Skyrim and Fallout 3Bethesda's Iterative Level Design Process for Skyrim and Fallout 3
Bethesda's Iterative Level Design Process for Skyrim and Fallout 3
 
Passing the Joel Test in the PHP World (phpbnl10)
Passing the Joel Test in the PHP World (phpbnl10)Passing the Joel Test in the PHP World (phpbnl10)
Passing the Joel Test in the PHP World (phpbnl10)
 
Idiomatic R for Rosetta Code (2013)
Idiomatic R for Rosetta Code (2013)Idiomatic R for Rosetta Code (2013)
Idiomatic R for Rosetta Code (2013)
 
Product development and tools
Product development and toolsProduct development and tools
Product development and tools
 
Pair Programming (2014)
Pair Programming (2014)Pair Programming (2014)
Pair Programming (2014)
 
Workshop fight legacy code write unit test
Workshop fight legacy code write unit testWorkshop fight legacy code write unit test
Workshop fight legacy code write unit test
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

Legacy code rehab.

  • 1. L egacy Cod e : Rehab lan A Workshop with @johnnono
  • 2. Me ● Spent a few years thinking about rewrites. ● Not an expert/guru. ● Written a load of crap.
  • 3. What is legacy? ● Code without tests? ● Old tech? ● Not the latest thing? ● Not invented here?
  • 4. Is lega cy so bad? Outside of software, how do we see legacy?
  • 5. getting aw ay with it Theres no Legacy is everywhere
  • 6. 2 choices Photo by John T Pilot Rebuild or Renovate
  • 7. Risks of R e-building ● Estimates always wrong. ● New bugs. ● Secret knowledge in the code. ● Lengthy code freeze. ● Organisation needs to wait for new features.
  • 8. But Renovating? ● The code is a mess. ● You don't know where to start. ● It has become poorly designed. ● It is typically untested.
  • 9. Bot ch it then? ● Just hack the change in. ● Code will be worse. ● Which leads to worse code.
  • 10. Right let's do it! ● Scratch refactor ● Tell the story of the system ● Sketches ● Characterization tests
  • 11. Cod e Sample Trivia Code base https://github.com/jbrains/trivia
  • 12. Scratch refactor ● Start playing with the code. ● Throw away the changes.
  • 13. Telling the story? ● Just the essentials ● Then move on to more granular bits ● Rinse & repeat.
  • 14. Sketches ● Feature sketches ● Effect Sketches ● Effect analysis
  • 15. C haracteriz ation tests ● Fail ● Pass ● Sensing variables ● Inheritance ● change access modifier ● Throwaway?
  • 17. Thanks ● This session is all about understanding the impact of change. ● Small safe steps. ● Vices.
  • 18. Feedback Email : johnnonolan@gmail.com Twitter: @johnnonolan