Lazy Class: What It Costs and How to Fix It
A class that does too little to justify its existence, adding complexity without proportionate value.
What It Is
A Lazy Class is a class that was created with good intentions (perhaps during an earlier refactoring or in anticipation of future needs) but does not carry enough behaviour or data to justify its existence. It might be a wrapper around a single method, a data class with no behaviour, or a class that was trimmed down during refactoring until only a shell remained. Every class has a maintenance cost: it must be understood, documented, tested, and navigated past. If the class does not earn its keep, that cost is pure waste.
Why It Costs Money
Navigation overhead. Every extra class is one more file to open, one more import to manage, and one more name to remember. In IDEs with 'find references' and 'go to definition,' lazy classes add unnecessary hops.
Conceptual weight. Each class represents a concept that developers must understand. A lazy class that wraps a single method forces developers to understand the wrapper's purpose (is it for testing? extensibility? legacy reasons?) before they can understand the code that uses it.
Maintenance cost is real even when the class does nothing meaningful. When the underlying concept changes, the lazy class must be updated even though it adds no value.
Specific Cost Mechanisms
- ●Navigation overhead: time spent navigating through unnecessary abstractions
- ●Conceptual confusion: new developers spend time understanding why the class exists
- ●Maintenance drag: each refactoring must account for the lazy class even when it adds no value
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 Low inputs; mid is halfway. See full methodology.
| Team Size | Low | Mid | High |
|---|---|---|---|
| 3 devs | $700 | $2K | $3K |
| 5 devs | $1K | $3K | $4K |
| 8 devs | $2K | $4K | $6K |
| 10 devs | $2K | $5K | $7K |
| 20 devs | $5K | $9K | $14K |
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.
Empty class body, single abstract method
Classes with < 3 methods or < 20 lines
Abstract classes with empty method bodies
Classes referenced in only 1-2 locations
Refactoring Patterns
Proven techniques to eliminate this smell. See all refactoring patterns.
Inline Class
The class has one caller and adds no independent value
Collapse Hierarchy
A subclass adds nothing to its parent
Merge Module
A module contains only one or two trivial classes