💡 All articles
- Delete unused code (and how to retrieve it)
Dead code adds noise to the codebase and should be deleted. Yet, deleted code feels harder to retrieve. Here's how to find such code easily with git!
- Can AI help me refactor legacy code?
Can assistants like ChatGPT refactor existing code without introducing bugs? Let's figure it out with an actual codebase.
- Can AI help me write tests on legacy code?
People are using tools like ChatGPT to write tests on existing code… But how reliable is this? Let's find out!
- Fake it until you automate it
A pragmatic way for you to start automating deployments of a Legacy system.
- Comparing 2 approaches of refactoring untested code
You need to change code that's not tested. How do you know you didn't break something? Let's compare 2 ways of doing that!
- Another way of refactoring untested code
You need to change code that's not tested. How do you know you didn't break something? Here is ANOTHER concrete way to tackle the problem.
- One way of refactoring untested code
You need to change code that's not tested. How do you know you didn't break something? Here is one concrete way to tackle the problem.
- 7 advice to help you inherit a legacy codebase
My recap of the most common and useful advice one can give to tackle Legacy codebases.
- Improve your refactoring and testing skills with the Expense Report kata
Watch Gregor Riegler refactor code with this coding exercise. Learn useful techniques from it.
- 3 must-watch talks on Legacy Code
I have hosted more than 37 speakers to talk about Legacy Code tips and tricks. Here is my top 3 of the talks you should probably watch!
- The key points of The Programmer's Brain
This book analyses how your brain works and gives concrete advice to help you work with Legacy Code. Here's my summary of its salient points.
- Testability, Empathy, and Safe Refactorings
4 great talks on Legacy Code that I had the pleasure to host. This edition particularly focuses on testing and refactoring.
- Can AI-based test generation help you test Legacy Code?
I experimented with tools that can generate tests for you, leveraging AI. Here is what I learned, along with some thoughts about testing unfamiliar code…
- Refactoring vs. Defactoring
Some thoughts about refactoring and the opposite operation: defactoring.
A reflection on coaching, facts, and pragmatism. Which testing framework would I recommend to devs who are not familiar with testing?
- DevOps, Living Documentation, and Hexagonal Architecture
5 great talks on Legacy Code that I had the pleasure to host. This edition raises new topic such as documentation and legacy pipelines.
- 4 tips to refactor a complex legacy app without automation tools
How do you refactor a complex legacy application when you can't rely on automation tools?
- Design Patterns, Empathy, and Reading Complex Code
4 great talks on Legacy Code that I had the pleasure to host. A focus on empathy and getting into complex codebases.
- Should we stick to old patterns or sacrifice consistency?
Consistency is great! But over time, it's hard to keep a codebase consistent. Here's my approach to adopt changes without creating a mess.
- What's the difference between Regression Tests, Characterization Tests, and Approval Tests?
You may have heard one or the others. Now you're confused: is there a difference? Nope! Let me explain…
- Keeping dependencies up-to-date
My recipe for recovering from outdated dependencies and keeping healthy habits
- Technical Debt, Rewrites, and Refactoring
5 great talks on Legacy Code that I had the pleasure to host. Learn how to prioritize Tech Debt and rewrite systems incrementally.
- Is it OK to change code for the sake of testing?
It seems necessary to start adding tests on this code… but what if it makes things worse?
- How to tell your client how bad their codebase is?
When work looks trivial from the outside, but you know it will actually take much longer to do.
- Safely restructure your codebase with Dependency Graphs
Even drawing them by hand can help you make sense of a tangled codebase! Let's see how they can help, and what tools you can use to generate these.
- The key points of Re-Engineering Legacy Software
Here's an interesting book on approaching Legacy Software. Here's my summary of its salient points.
- Does refactoring Legacy Code pay off in your career?
Working on Legacy systems can be extremely beneficial to your career… If you can explain why it matters to the business!
- Refactoring, Unit Tests, and Symmathesy
5 great talks on Legacy Code that I had the pleasure to host. Learn how to progressively migrate existing codebase towards a better state.
- The key points of Beyond Legacy Code
This book is filled with practical strategies to apply on Legacy systems. Here's my summary of its salient points.
- When is it the best time to refactor?
Should you plan time for refactoring during Sprints? Refactor before you release new features? After? Here's my suggestion…
- Work faster and safer on untested code with Overcommitting
A technique you can resort to when you need to make risky changes.
- The best way to start testing untested code
Should you write E2E tests to cover more cases faster? Or is there a better approach?
- What you can do when code is really hard to review
5 advice you can try when you feel paralyzed with a change that's too risky to merge, but too long to verify.
- The key points of The Legacy Code Programmer's Toolbox
This book is full of tips to get into an unfamiliar codebase. Here's my summary of its salient points.
- Approval Tests, TCR, and Menders
5 great talks on Legacy Code that I had the pleasure to host. Learn how to test existing code and approach unfamiliar codebases.
- When should you stop refactoring Legacy Code?
A personal story to illustrate how good habits can save your day when things turn bad.
- 4 developers working their way through Legacy Code
Practice working with code you've never seen before helps make it easier. Here's my selection of videos that will expose you to seasoned developers doing that!
- Where should you put the documentation?
What you should be looking for to build a great and useful documentation.
- Start cleaning your Legacy codebase with The Daily Refactoring Hour
Building the habit of small refactorings as you go will make a difference in the long run.
- Identify who to ask for help with Knowledge Maps
Learn to draw a Knowledge Map of your codebase within minutes, and find out who owns what!
- Quickly improve code readability with Proximity Refactorings
Here's a technique that leverages how your brain works to make any code easier to work with.
- The key points of Software Design X-Rays
This book is a gold mine. Yet, it's not a famous one. Here's my summary of its salient points that can help you deal with large codebases.
- 7 techniques to regain control of your Legacy codebase
Working with Legacy Code is no fun… unless you know how to approach it and get your changes done, safely.
- If you mock, are you even testing?
Is this the real code? Is this just fantasy? Let's discuss the problem with unit testing Legacy Code and an approach you can take.
- Convince managers to address Tech Debt with Enclosure Diagrams
How to come up with a plan that will resonate with non-technical people, in 7 concrete steps.
- Demine your codebase in 30min with Exploratory Refactoring
When you're stuck trying to understand some code, it pays off to spend some time with a different approach.
- 7 practices for a successful code handover
Code handovers are critical moments in the lifetime of a project. Make the most out of it with these advice.
- Reveal the structure of long methods with an online Word Counter
You don't need fancy tools to start making a dent on a scary method. Simply take a step back.
- A quick way to add tests when code has database or HTTP calls
You need to fix a bug, but you can't spend a week on it? Here's a technique to isolate problematic side-effects and write tests within minutes.
- Bring Legacy Code under tests by handling global variables
What's the best way to deal with these annoying global variables? Make them explicit.
- Earn future maintainers esteem by writing simple ADRs
With Legacy Code, there is never any good documentation. Hopefully, there's a simple way for you to stop that trend.
- Is it fine to use "AND" in a function name?
Finding a better name for a function is hard, especially when people have contradictory opinions on what a good name looks like…
- 5 talks on Legacy Code: The Legacy of SoCraTes, 1st edition
Tips and advice on dealing with Legacy Code from 5 great speakers at this remote conference I organized for the community.
- Focus refactoring on what matters with Hotspots Analysis
Here's a way to prioritize refactoring when you have to deal with a large, unmaintainable codebase.
- Don't make Clean Code harder to maintain, use the Rule of Three
If you worry that following clean code practices create more code to maintain, here's a way out.
- Are functions that simply call another function a bad design choice?
Let's see how you end up with these while trying to refactor Legacy Code and what you can do about that.
- What is wrong with boolean parameters?
And 4 ways to fix their usage in Legacy Code.
- 5 coding exercises to practice refactoring Legacy Code
Feeling overwhelmed by your legacy codebase? These katas will help you learn how to tackle it.
- Dive into an unfamiliar codebase from its edges
Do you feel paralyzed, wondering how to approach a legacy codebase? Try to start from the system edges.
- The key points of Working Effectively with Legacy Code
This book is a reference. Here's my summary of its salient points so you understand why it's so recommended.
- 5 arguments to make managers care about technical debt
If you think that management wouldn't let you refactor Legacy Code, use these 5 arguments to convince them.
- The Ship of Theseus to NOT rewrite a legacy system from scratch
When an application becomes impossible to maintain, a rewrite is very tempting. But it could make things worse.
- Is it up to the newer developer to pay back others' technical debt?
And what you can do about it if you find yourself in such situation.
- Use the Mikado Method to do safe changes in a complex codebase
When a codebase is large and complex, it's risky to big changes. Here's a structured way to approach the problem.
- 3 steps to add tests on existing code when you have short deadlines
Here's a recipe you can follow when you want to add tests on Legacy Code, but you don't have much time to do so.
- What is Legacy Code? Is it code without tests?
Here's a useful definition of "Legacy Code" you can refer to.
Written by Nicolas Carlo who lives and works in Montreal, Canada 🍁
He founded the Software Crafters Montreal community which cares about building maintainable softwares.