SlideShare une entreprise Scribd logo
1  sur  18
Télécharger pour lire hors ligne
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

Contenu connexe

En vedette (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...
 

Similaire à 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
 

Similaire à 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
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+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@
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
+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...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

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