Testability, Empathy, and Safe Refactorings

Struggling with Legacy Code and not enough time to clean it up?
⛑️️ My First Aid Kit can help you rescue any codebase quickly and safely!

On November 24, 2021, I co-organized the 8th edition of The Legacy of SoCraTes with my partner in crime Adrian Bolboacă.

It’s a half-a-day remote conference where 4 speakers share their tips to deal with Legacy Code.

The Legacy of SoCraTes by Nicolas Carlo and Adrian Bolboacă

In this edition, we talked about testing a lot. Testing legacy code can be painful… but this pain can guide you towards a better design!

We also discussed attitudes in tech. While it’s easy to make fun of “past developers who created this mess”, it doesn’t really help anyone to do so.

Finally, Jay did a deep dive into refactoring gnarly code… when you don’t have tests.

As usual, we recorded all the talks so you can watch and share them with your friends and colleagues!

Engineering for Software: How to Amplify Creativity

Dave Farley is the author of Continuous Delivery and a thought leader in the field 👨‍🎤

I love how he regularly shares nuggets of golden advice on his YouTube channel. He covers a lot of topics… including working with Legacy Code!

In this talk, Dave digs into the tools software developers can use to do a better job: Testability and Speed.

Using tests pain as a design guide

Barry O Sullivan is a PHP developer with a ton of experience dealing with Legacy Code. He believes it doesn’t have to be painful… I agree!

This is better said than done. That’s why in this talk, Barry dives into the usual problems you get when you start testing existing code:

  • Long dependency bootstrapping chains
  • Having to use partial mocks all around
  • Dealing with magical injections of objects and data
  • Seeding DB data everywhere
  • In the end, having a hard time reading tests code!

Hopefully, this gives you concrete ideas to start improving your own tests!

Let’s Stop Making Each Other Feel Stupid

Have you ever heard colleagues making fun of someone who didn’t know the basic thing of software development?

I’ve been guilty of that myself ✋

The thing is: it doesn’t really help anyone. Actually, it contributes to creating a culture where people don’t feel safe sharing what they know or don’t. Hopefully, we can do something about it: take this as an opportunity to teach!

Clare Sudbery is a lead engineer with Made Tech. She is also a maths graduate with 21 years of software experience. In this talk, she shares personal stories about gatekeeping in tech… and helpful advice to do better.

Relevant XKCD for this talk:

Every day, ten thousands of US people hear something for the first time

I also recommend Clare’s podcast: Making Tech Better where she hosts thoughts leaders of the industry to talk about the various topic of their expertise.

How we use safe refactoring to untangle gnarly code without tests

Finally, I received Jay Bazuzi.

In this talk, Jay answers the evergreen question:

But wait… how would I refactor code without having tests?

Well, turns out there is a way. Jay uses Provable Refactorings, Arlo’s Commit Notation, and leans on the tooling available to safely refactor code that’s not covered with tests:

“These talks are really great! Can I have more?”

Sure thing!

There’s no fixed schedule, but I like to organize this short conference every few months. I reach out to a few speakers to build an interesting agenda, then we set up the event.

Everything is FREE. Attending is the opportunity to directly ask questions to these speakers, from the comfort of your home.

If that’s something you want to hear about, subscribe to my newsletter below 👇

I publish my monthly tips on Legacy Code here. I also foretell my subscribers about the conference agenda, so they don’t miss out. Join them!

Nicolas Carlo

Written by Nicolas Carlo who lives and works in Montreal, Canada 🍁
He founded the Software Crafters Montreal community which cares about building maintainable softwares.

Similar articles that will help you…

Find how to (re)organize code with git

Does your codebase feel like a tote bag of "shared" and "utils" folder? Git may help you find a better structure.

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.

Fake it until you automate it

A pragmatic way for you to start automating deployments of a Legacy system.

← Find more tips to work with Legacy Code