Change PreventersHigh

Divergent Change: What It Costs and How to Fix It

A single class that must be modified for many different, unrelated reasons.

Model cost, team of 8$6K-$24K/yr
Severity
4/5
CategoryChange Preventers
Detection4 tools

What It Is

Divergent Change is the opposite of Shotgun Surgery. Instead of one change requiring edits in many classes, Divergent Change means a single class is modified for many unrelated reasons. If you change the class when a database schema changes, when a UI requirement changes, and when a business rule changes, you have Divergent Change. The class has accumulated responsibilities from multiple domains, making it a bottleneck that every change must flow through.

Threshold: If a class changes for 3+ unrelated reasons within a sprint, it has Divergent Change. Git history is the most reliable detector: look for files modified in commits with unrelated messages.

Why It Costs Money

1

The class becomes a merge conflict hotspot. When unrelated changes (database, UI, business logic) all modify the same file, developers working on independent features collide. The more unrelated reasons the class has to change, and the more people changing it, the more often those changes meet in the same file.

2

Testing is expensive because each change reason has different test requirements. Database changes need integration tests, UI changes need rendering tests, business logic needs unit tests, and they all live in the same class.

3

Code review quality drops. Reviewers cannot specialise: a database expert reviewing a PR that also contains UI changes in the same file must review code outside their expertise or approve blindly.

Specific Cost Mechanisms

  • ●Merge conflicts: whenever two changes in flight touch the same coupled pair
  • ●Cross-domain testing: each change requires running all test categories for the class
  • ●Review quality: mixed-concern PRs are harder to review, because each change has to be checked against several unrelated concerns

Estimated Annual Cost

Cost of one instance a year by team size, from our model at $180K fully-loaded cost per engineer. Low and high use the bottom and top of the High inputs; mid is halfway. See full methodology.

Team SizeLowMidHigh
3 devs$3K$7K$11K
5 devs$4K$10K$16K
8 devs$6K$15K$24K
10 devs$7K$19K$30K
20 devs$14K$35K$57K

These are model outputs, not measurements. Every input is on the cost model page, and the same model produces the figures on the 22 smells page. Put in your own team and cost in the smell profile calculator.

How to Detect It

Specific rules and thresholds for automated detection. See full tool comparison.

SonarQube
squid:S1200 / squid:S2972

High class coupling and many responsibilities

CodeClimate
method-count / file-lines

Large files that change frequently across commits

Git analysis
git log --format='%H' -- file | wc -l

Files with highest commit frequency across different feature branches

CodeScene
Hotspot analysis

Identifies files changed by many different authors for different reasons

Refactoring Patterns

Proven techniques to eliminate this smell. See all refactoring patterns.

Extract Class

Groups of methods that serve distinct change reasons

Effort (our estimate): 4-12 hours per extraction
Impact: Each extraction removes one change reason from the class

Extract Module/Package

The extracted classes form a coherent domain boundary

Effort (our estimate): 8-24 hours
Impact: Creates clear domain boundaries that prevent future divergence

Apply Single Responsibility Principle

The class has 3+ identifiable change reasons

Effort (our estimate): 8-16 hours total
Impact: Each class then changes for one reason, so unrelated features stop colliding in it

Related Smells

Updated November 2026