Refactoring and test structure advice

Working Effectively with Legacy Code and AI Coding Assistant - Michael Feathers

Topic 8 of 22

Published Oct 14, 2024 · Clip 22:49–26:12 (3:23)

Michael strongly endorses Martin Fowler's Refactoring book, citing Ralph Johnson's insight that good design can be taught by teaching what to avoid—code smells—and everything left is good design. He explains refactoring clarifies systems until change becomes easier. On test structure, he argues the unit-vs-integration-test debate is unproductive; what matters is testing behaviors at the best vantage point, often spanning multiple classes, and building lower-level tests that make higher levels easier.