Skip to Content

Michael Feathers: Be Curious & Chase The Rabbit Holes

EP-028 | October 21, 2019 | 32:14 | Last updated: August 7, 2024

Legacy Code Refactoring Code Quality

Michael Feathers

Founder & Director of R7K Research & Conveyance, R7K Research & Conveyance

Author of 'Working Effectively with Legacy Code', one of the most influential books on software maintenance and refactoring.

In this episode of the Maintainable Software Podcast, Robby speaks with Michael Feathers, Director at R7K Research & Conveyance and author of "Working Effectively with Legacy Code." Michael shares his unique definition of legacy code, emphasizing that legacy code is essentially code without tests. This foundational idea highlights the critical role of automated testing in refactoring and maintaining codebases.

Michael and Robby dive into common issues developers face, such as low test coverage and the perceived optionality of writing tests. They explore how ego and human nature often influence developers' decisions not to write tests, even when frameworks provide the tools to do so.

One of the intriguing concepts discussed is a test-first IDE, which encourages writing tests before methods. Michael shares patterns and practices for integrating testing into existing projects, emphasizing the importance of social reinforcement and team collaboration in improving test coverage.

The conversation also touches on the importance of code quality traits like understandability and simplicity. Michael stresses that empathy in code quality impacts co-workers and that objective measures for code quality often stem from solid design principles. They also discuss the role of code analysis tools in understanding code quality.

Removing unused code from applications is another key topic, with Michael sharing insights on the relationship between business decisions and code maintenance. The discussion extends to Conway's Law and its effect on code design, providing valuable context for understanding how organizational structure influences software development.

Michael shares lessons from his early career, emphasizing the importance of curiosity and deep systems thinking in software development. He also discusses his upcoming projects, including the second edition of "Working Effectively with Legacy Code."

Key Takeaways:

  • Legacy code is code without tests.
  • Automated testing is crucial for refactoring and maintaining codebases.
  • Developers often perceive writing tests as optional, impacting code quality.
  • Social reinforcement and team collaboration are vital for improving test coverage.
  • Empathy in code quality positively affects co-workers.
  • Solid design principles help objectively measure code quality.
  • Removing unused code is essential for maintaining a clean codebase.
  • Conway's Law illustrates how organizational structure impacts code design.
  • Curiosity and deep systems thinking are valuable traits for software developers.

Resources Mentioned:

Frequently Asked Questions

What does Michael Feathers recommend for working with legacy code?

Michael recommends being curious and exploring code deeply — 'chasing the rabbit holes.' He advocates for writing characterization tests to understand existing behavior before making changes.

How does Michael Feathers define legacy code?

In his influential book, Michael defines legacy code simply as code without tests. Without tests, you can't verify that changes don't break existing behavior, making the code risky to modify.

What is Michael Feathers' approach to improving untested code?

Michael recommends the 'seam' technique — finding points in code where you can alter behavior without editing the code directly. This makes it possible to get legacy code under test safely.

🎧 Listen from Anywhere 🪐

Listen on all the major podcast platforms.

Between the episodes

223 Episodes published since 2019

Stay sharp. Skip the noise.

One email when a new episode drops. That's it.

Joined by engineering leaders at companies you've heard of.