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

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
 

Último (20)

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
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...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
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
 
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...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
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
 
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
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 

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