07
Divergent Change
Symptom
One module changes for many unrelated reasons — one part for tax law updates, another for UI changes, another for API shape drift.
Goal
Each module changes for one reason — the kinds of changes that touch it cluster around a single axis of variation.
Smellier version
function checkout(cart) {
const tax = computeTax(cart, jurisdiction); // tax churn
const html = renderInvoice(cart, tax); // UI churn
return postToGateway(html); // API churn
}Fresher versionfunction priced(cart) { return { ...cart, tax: computeTax(cart) }; }
function rendered(cart) { return renderInvoice(cart); }
function sent(html) { return postToGateway(html); }Savings
Owners and reviewers are obvious; tests are focused; teams can move in parallel without colliding.
Note
Every team's churn lands in the same file; merges become contentious; testing one concern requires understanding all of them.