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
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

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
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
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...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
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
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
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
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
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...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
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
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
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
 
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...
 

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