@asgrim 󰑒
Living the Best Life on a
Legacy Project
James Titcumb
phpday 2022
$ whoami
James Titcumb
www.jamestitcumb.com
www.roave.com
@asgrim
@asgrim 󰑒
So, you joined a new team.
@asgrim 󰑒
WTF per minute: 0
@asgrim 󰑒
WTF per minute: 0
@asgrim 󰑒
WTF per minute: 1
@asgrim 󰑒
WTF per minute: 3
@asgrim 󰑒 WTF per minute: 15
@asgrim 󰑒 WTF per minute: 256
@asgrim 󰑒
Living the Best Life on a Legacy Project (phpday 2022).pdf
@asgrim 󰑒
"Legacy"
@asgrim 󰑒
"Legacy"
@asgrim 󰑒
"Legacy"
Can mean...
● Old code
● Code that uses outdated patterns
● Obsolete (but still used)
● Difficult to maintain
● Uses old frameworks / libraries
● Fragile / untouchable
● Expensive to replace
@asgrim 󰑒
"Legacy"
Can mean...
● Old code
● Code that uses outdated patterns
● Obsolete (but still used)
● Difficult to maintain
● Uses old frameworks / libraries
● Fragile / untouchable
● Expensive to replace
● Working code
● Code that (usually) still provides VALUE
● Code written an hour ago
@asgrim 󰑒
"Code can be in two states:
in production
...or almost useless"
- Srdjan Vranac (@vranac)
@asgrim 󰑒
Result of Fast Iteration
@asgrim 󰑒
Result of Years of Stability
@asgrim 󰑒
"Legacy" !== "bad"
@asgrim 󰑒
Refactoring
@asgrim 󰑒
"If it ain't broke, don't fix it"
- Someone in USA, probably
@asgrim 󰑒
Living with Legacy Existing Code
General skills
@asgrim 󰑒
Business Communication
@asgrim 󰑒
Peer Communication
@asgrim 󰑒
Agree direction
@asgrim 󰑒
Define processes
@asgrim 󰑒
Produce documentation
Technical skills & approaches
@asgrim 󰑒
Reading code.
@asgrim 󰑒
Understanding code.
@asgrim 󰑒
Understanding code.
Review code!
@asgrim 󰑒
Understanding code.
Try using a step debugger!
@asgrim 󰑒
Understanding code.
Write tests to characterise the code!
@asgrim 󰑒
Understanding the business.
@asgrim 󰑒
Success factor
😊
Developer Experience + Business Value = Happiness
@asgrim 󰑒
Should you refactor?
@asgrim 󰑒
Don't refactor for tech reasons alone
@asgrim 󰑒
When you DO decide to refactor
@asgrim 󰑒
Limit your scope
@asgrim 󰑒
Make a plan
@asgrim 󰑒
Tooling
@asgrim 󰑒
Coding standards
@asgrim 󰑒
@asgrim 󰑒
@asgrim 󰑒
Static Analysis "Whack-a-Mole"
@asgrim 󰑒
Testing
@asgrim 󰑒
Starting from nothing
@asgrim 󰑒
Starting from something bad
@asgrim 󰑒
Good tests > Bad tests > No tests
@asgrim 󰑒
Make good testing habits
@asgrim 󰑒
Make all team members reviewers
@asgrim 󰑒
Feedback, don't "gatekeep"
@asgrim 󰑒
Policies
"Usual" policies
@asgrim 󰑒
Policies
"Flexible" policies
@asgrim 󰑒
@asgrim 󰑒
One approach to tackle "no tests"
@asgrim 󰑒
Focus on critical functionality
@asgrim 󰑒
Then build up day-to-day
@asgrim 󰑒
Limit the scope of characterisation tests
@asgrim 󰑒
Delete the test…?
@asgrim 󰑒
Make sure tests are run in CI
@asgrim 󰑒
@asgrim 󰑒
Automate all the checks!
@asgrim 󰑒
To summarise...
"Legacy" !== "bad"
● It's just "existing code"
● If it's in production, it usually produces VALUE
How to tackle existing codebase?
● You don't always need to refactor
● Communicate - peers & business
● Produce documentation
● Learn to really READ code!
● Determine what produces VALUE (both business value + developer experience)
● Use tools to help improve code quality
● Characterise critical functionality with tests
● Build up your "test pyramid"
● Automate all the things!
Any questions?
James Titcumb 🥃
@asgrim

More Related Content

PDF
Tips for Tackling a Legacy Codebase (ScotlandPHP 2021)
PDF
Best practices for crafting high quality PHP apps (Bulgaria 2019)
PDF
How to improve the quality of your application
PDF
Crafting Quality PHP Applications (PHP Joburg Oct 2019)
PDF
Best practices for crafting high quality PHP apps (php[world] 2019)
PDF
The bigrewrite
PPTX
Cleaning Code - Tools and Techniques for Large Legacy Projects
PDF
Old Code, New Tricks
Tips for Tackling a Legacy Codebase (ScotlandPHP 2021)
Best practices for crafting high quality PHP apps (Bulgaria 2019)
How to improve the quality of your application
Crafting Quality PHP Applications (PHP Joburg Oct 2019)
Best practices for crafting high quality PHP apps (php[world] 2019)
The bigrewrite
Cleaning Code - Tools and Techniques for Large Legacy Projects
Old Code, New Tricks

Similar to Living the Best Life on a Legacy Project (phpday 2022).pdf (20)

PPTX
The bigrewrite
PPTX
Software craftsmanship and you a strong foundation in your team
PDF
Crafting Quality PHP Applications (ConFoo YVR 2017)
PDF
Crafting Quality PHP Applications (Bucharest Tech Week 2017)
PDF
Best practices for crafting high quality PHP apps (PHP Yorkshire 2018)
PDF
Crafting Quality PHP Applications: an overview (PHPSW March 2018)
PDF
Crafting Quality PHP Applications (PHP Benelux 2018)
PDF
How to Start Your Application Modernization Journey
PDF
Best practices for crafting high quality PHP apps (ScotlandPHP 2018)
PDF
Best practices for crafting high quality PHP apps (PHP South Africa 2018)
PPTX
Refactoring workshop
PDF
So You Just Inherited a $Legacy Application...
PDF
Code Camp NYC 2017 - How to deal with everything... | Chris Ozog - Codesushi
PDF
Refactoring: the good, the bad and the ugly.
PDF
So You Just Inherited a $Legacy Application… NomadPHP July 2016
PDF
Mine Your Own Code
PDF
Crafting Quality PHP Applications (PHPkonf 2018)
PPTX
You cant be agile if your code sucks
PDF
From Mess To Masterpiece - JFokus 2017
ODP
Path dependent-development (PyCon India)
The bigrewrite
Software craftsmanship and you a strong foundation in your team
Crafting Quality PHP Applications (ConFoo YVR 2017)
Crafting Quality PHP Applications (Bucharest Tech Week 2017)
Best practices for crafting high quality PHP apps (PHP Yorkshire 2018)
Crafting Quality PHP Applications: an overview (PHPSW March 2018)
Crafting Quality PHP Applications (PHP Benelux 2018)
How to Start Your Application Modernization Journey
Best practices for crafting high quality PHP apps (ScotlandPHP 2018)
Best practices for crafting high quality PHP apps (PHP South Africa 2018)
Refactoring workshop
So You Just Inherited a $Legacy Application...
Code Camp NYC 2017 - How to deal with everything... | Chris Ozog - Codesushi
Refactoring: the good, the bad and the ugly.
So You Just Inherited a $Legacy Application… NomadPHP July 2016
Mine Your Own Code
Crafting Quality PHP Applications (PHPkonf 2018)
You cant be agile if your code sucks
From Mess To Masterpiece - JFokus 2017
Path dependent-development (PyCon India)
Ad

More from James Titcumb (19)

PDF
Climbing the Abstract Syntax Tree (Midwest PHP 2020)
PDF
Climbing the Abstract Syntax Tree (php[world] 2019)
PDF
Climbing the Abstract Syntax Tree (PHP Russia 2019)
PDF
Best practices for crafting high quality PHP apps - PHP UK 2019
PDF
Climbing the Abstract Syntax Tree (ScotlandPHP 2018)
PDF
Kicking off with Zend Expressive and Doctrine ORM (PHP South Africa 2018)
PDF
Climbing the Abstract Syntax Tree (PHP Developer Days Dresden 2018)
PDF
Climbing the Abstract Syntax Tree (Southeast PHP 2018)
PDF
Kicking off with Zend Expressive and Doctrine ORM (PHP MiNDS March 2018)
PDF
Climbing the Abstract Syntax Tree (PHP UK 2018)
PDF
Dip Your Toes in the Sea of Security (ConFoo YVR 2017)
PDF
Kicking off with Zend Expressive and Doctrine ORM (ConFoo YVR 2017)
PDF
Climbing the Abstract Syntax Tree (Forum PHP 2017)
PDF
Dip Your Toes in the Sea of Security (IPC Fall 2017)
PDF
Climbing the Abstract Syntax Tree (IPC Fall 2017)
PDF
Dip Your Toes in the Sea of Security (PHP South Africa 2017)
PDF
Climbing the Abstract Syntax Tree (PHP South Africa 2017)
PDF
Get Started with RabbitMQ (CoderCruise 2017)
PDF
Dip Your Toes in the Sea of Security (CoderCruise 2017)
Climbing the Abstract Syntax Tree (Midwest PHP 2020)
Climbing the Abstract Syntax Tree (php[world] 2019)
Climbing the Abstract Syntax Tree (PHP Russia 2019)
Best practices for crafting high quality PHP apps - PHP UK 2019
Climbing the Abstract Syntax Tree (ScotlandPHP 2018)
Kicking off with Zend Expressive and Doctrine ORM (PHP South Africa 2018)
Climbing the Abstract Syntax Tree (PHP Developer Days Dresden 2018)
Climbing the Abstract Syntax Tree (Southeast PHP 2018)
Kicking off with Zend Expressive and Doctrine ORM (PHP MiNDS March 2018)
Climbing the Abstract Syntax Tree (PHP UK 2018)
Dip Your Toes in the Sea of Security (ConFoo YVR 2017)
Kicking off with Zend Expressive and Doctrine ORM (ConFoo YVR 2017)
Climbing the Abstract Syntax Tree (Forum PHP 2017)
Dip Your Toes in the Sea of Security (IPC Fall 2017)
Climbing the Abstract Syntax Tree (IPC Fall 2017)
Dip Your Toes in the Sea of Security (PHP South Africa 2017)
Climbing the Abstract Syntax Tree (PHP South Africa 2017)
Get Started with RabbitMQ (CoderCruise 2017)
Dip Your Toes in the Sea of Security (CoderCruise 2017)
Ad

Recently uploaded (20)

PDF
“The Future of Visual AI: Efficient Multimodal Intelligence,” a Keynote Prese...
PDF
4 layer Arch & Reference Arch of IoT.pdf
PDF
Transform-Your-Factory-with-AI-Driven-Quality-Engineering.pdf
PDF
Comparative analysis of machine learning models for fake news detection in so...
PDF
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
PDF
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
PDF
Aug23rd - Mulesoft Community Workshop - Hyd, India.pdf
PDF
Introduction to MCP and A2A Protocols: Enabling Agent Communication
PDF
Data Virtualization in Action: Scaling APIs and Apps with FME
PPTX
agenticai-neweraofintelligence-250529192801-1b5e6870.pptx
PDF
Accessing-Finance-in-Jordan-MENA 2024 2025.pdf
PDF
The-2025-Engineering-Revolution-AI-Quality-and-DevOps-Convergence.pdf
PDF
AI.gov: A Trojan Horse in the Age of Artificial Intelligence
PDF
LMS bot: enhanced learning management systems for improved student learning e...
PDF
Transform-Your-Supply-Chain-with-AI-Driven-Quality-Engineering.pdf
PDF
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
PPTX
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
PDF
Connector Corner: Transform Unstructured Documents with Agentic Automation
PPTX
Microsoft User Copilot Training Slide Deck
PDF
5-Ways-AI-is-Revolutionizing-Telecom-Quality-Engineering.pdf
“The Future of Visual AI: Efficient Multimodal Intelligence,” a Keynote Prese...
4 layer Arch & Reference Arch of IoT.pdf
Transform-Your-Factory-with-AI-Driven-Quality-Engineering.pdf
Comparative analysis of machine learning models for fake news detection in so...
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
Aug23rd - Mulesoft Community Workshop - Hyd, India.pdf
Introduction to MCP and A2A Protocols: Enabling Agent Communication
Data Virtualization in Action: Scaling APIs and Apps with FME
agenticai-neweraofintelligence-250529192801-1b5e6870.pptx
Accessing-Finance-in-Jordan-MENA 2024 2025.pdf
The-2025-Engineering-Revolution-AI-Quality-and-DevOps-Convergence.pdf
AI.gov: A Trojan Horse in the Age of Artificial Intelligence
LMS bot: enhanced learning management systems for improved student learning e...
Transform-Your-Supply-Chain-with-AI-Driven-Quality-Engineering.pdf
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
Connector Corner: Transform Unstructured Documents with Agentic Automation
Microsoft User Copilot Training Slide Deck
5-Ways-AI-is-Revolutionizing-Telecom-Quality-Engineering.pdf

Living the Best Life on a Legacy Project (phpday 2022).pdf