Legacy Code Boot Camp
Published by O'Reilly Media, Inc.
Analyzing, improving, and maintaining existing systems
Course outcomes
- Understand what you need to know to make changes in a code base
- Know the safety risks of starting to make changes
- Explore context loss and how to recover it
Course description
Engineers spend the vast majority of their careers analyzing, maintaining, and modifying existing systems. Those systems have often already been subject to the forces of time and change, and chief among those forces is the loss of context about how the system works.
Join expert Chelsea Troy to explore how to recover lost context and how to tell when you have enough information to attempt changes to legacy code. You’ll examine how to make a legacy code base easier to modify and chart a path to refactoring for learning, for making changes, and for ensuring that future changes are easier. You’ll also learn realistic and saleable strategies for preventing future context loss to keep the code base maintainable over the long term.
Week 1: Analyzing Your Code Base
Week 2: Modifying and Maintaining Your Code Base
Week 3: Future-Proofing Your Code Base
NOTE: With today’s registration, you’ll be signed up for all six days over the three-week course. Although you can attend any of the sessions individually, we recommend participating in all six sessions.
What you’ll learn and how you can apply it
- Answer questions about the code base ahead of making a change
- Identify relatively low-risk starting points for change
- Embark on low-risk initial changes to make a code base more maintainable
- Ramp up to features and modifications
- Move code from an interim “healing” state to a more maintainable future
- Hold the right information in the right places for future use
This live event is for you because...
- You’re a senior software engineer or tech lead.
- You work with a team of technical contributors on a legacy code base.
- You want to become an engineering director or principal engineer.
Prerequisites
- A working knowledge of Python
Recommended preparation:
- Explore the take-home exercises (GitHub repository)
Recommended follow-up:
- Read Working Effectively with Legacy Code (book)
Schedule
The time frames are only estimates and may vary according to how the class is progressing.
Week 1: Analyzing Your Code Base
Day 1
Legacy code and context loss (60 minutes)
- Presentation: What makes legacy code hard to work with?; forces that impact legacy code over time; context loss
- Group discussion: What characteristics of your code make it legacy code?
- Q&A
- Hands-on exercise: What’s the most egregious example of context loss from your work?
- Break
Recovering lost context (60 minutes)
- Presentation: Software analysis—the skill of recovering lost context; software analysis tools; identifying or generating tight feedback loops; identifying or generating ways to mark checkpoints; debugging as hypothesis testing; introduction of take-home activity (investigate patch decorator and determine how it handles preserving the code’s original functionality)
- Group discussion: Recovering context; context recovery processes; examples of context loss you’re having on your team
- Q&A
Day 2
Case studies (60 minutes)
- Presentation: Review of take-home activity; identifying seams to help with code investigation
- Group discussion: Case studies from yesterday’s discussion
- Q&A
- Break
Forensic software analysis (60 minutes)
- Presentation: The role of incrementality in forensic software analysis; convincing the business of the value in forensic software analysis (the case for maintenance load reduction); using tight feedback loops, checkpoints, and hypothesis testing to start to change a legacy code base; introduction of take-home activity (change test runner to run all tests in a suite)
- Group discussion: The perfect as enemy of the good in learning about a code base that has suffered context loss; changes your team is trying to make in one of your legacy systems
- Q&A
Week 2: Modifying and Maintaining Your Code Base
Day 1
Case studies (60 minutes)
- Presentation: Review of take-home activity
- Group discussion: Case studies from last week’s discussion
- Q&A
- Break
Risk-mitigation changes (60 minutes)
- Presentation: Code changes for high risk areas to reduce risk and enable further change; understanding what it looks like as code bases “heal” (it’s not prettier right away); decision tree for changes in a legacy code base; introduction of take-home activity (describe how you’d use the decision tree to address the addition of sorting to this data analysis library)
- Group discussion: Have you ever seen any of these risk mitigation changes used?; scenarios in which you’d like to see a decision tree used
- Q&A
Day 2
Case studies (60 minutes)
- Presentation: Review of take-home activity; adding more aggressive changes to decision tree
- Group discussion: Case studies from yesterday’s discussion
- Q&A
- Break
Addressing the cycle of context loss (60 minutes)
- Presentation: Case studies of more aggressive changes; context loss during or after making changes; introduction of take-home activity (add sorting to the data analysis library)
- Group discussion: A change your team is making or that you’d all like to make and how you’ll make this change a maintainable and sustainable one for the future
- Q&A
Week 3: Future-Proofing Your Code Base
Day 1
Documenting context (60 minutes)
- Presentation: Review of take-home activity; preventing context loss from degrading in the future with effective documentation; identifying where and how to document each piece of context
- Q&A
- Group discussion: What’s your team’s documentation strategy and is it working?
- Break
Case studies (60 minutes)
- Group discussion: Case studies from last week’s discussion; What objections does your team currently raise to the changes you’d like them to make or the processes you’d like them to use? Presentation: Introduction of take-home activity (propose a documentation strategy for this data analysis library)
Day 2
Closing the loop (60 minutes)
- Presentation: Review of take-home activity; socializing tactics to future-proof your code among your team; “closing the loop” on healing the changes you’ve started in a legacy code base
- Group discussion: What unfinished changes have you seen in legacy code bases? How would you propose finishing them?
- Break
Case studies (60 minutes)
- Group discussion: Case studies from yesterday’s discussion
- Presentation: Creating a strategy for your team; additional resources and where to turn next
- Q&A
Your Instructor
Chelsea Troy
Chelsea Troy leads the machine learning operations team at Mozilla. She also teaches in the Master’s Program in Computer Science at the University of Chicago. Her online workshop, Fundamentals of Technical Debt, is available On Demand through the O’Reilly platform, and she also gives live courses about machine learning, large language models, and product thinking.