Categories
Extreme Programming Fit for Purpose Kanban Programming

A Four-Point Lens for Changing Legacy Code

Legacy systems often feel like ticking time bombs, every modification risks new defects, delivery slows to a crawl, and engineers whisper “Don’t touch that module.” The underlying problem is decision paralysis: teams debate whether to change code instead of why. Michael Feathers simplifies the dilemma into four clear reasons to touch software: add a feature, fix a bug, improve design, or optimize resource usage. When you label work this way, ambiguity shrinks and the fear loop breaks, changes become purposeful, not arbitrary.

The lesson is that each reason demands a different strategy. Adding a feature? Wrap seams and write characterization tests first. Fixing a bug? Reproduce it with a failing test and refactor only the affected slice. Improving design? Use small, mechanical refactorings to reduce risk. Optimizing resources? Benchmark before and after so performance gains are explicit. Recognizing which reason applies helps teams choose the right tooling, test depth, and rollout plan, maximizing flow while minimizing regression risk.

Action Plan for Tech Managers:

1️⃣ Tag work items by reason in your backlog (Feature, Bug, Design, Optimise). Use color codes on your Kanban board.

2️⃣ Define guardrails per tag: e.g., “Bug → must start with failing test”; “Design → no functional change in the same commit.”

3️⃣ Align metrics: Feature work tracks lead-time to prod; Bug work tracks MTTR; Design refactors track code-quality deltas (cyclomatic complexity, coupling); Optimisation tracks CPU/memory drop.

4️⃣ Schedule refactor slots: reserve 15% of sprint capacity for Design or Optimise cards—this prevents entropy while keeping value delivery visible.

Within a few iterations, you’ll notice calmer stand-ups (“This is a Design card; here’s the safety net we added”), shorter feedback loops, and a backlog that balances new value with code health. By viewing every change through Feathers’ four-point lens, you turn legacy code from liability into a platform that evolves as fast as the business.