17 — Design & Architecture Smells¶
Driving question: Can a smell detector distinguish “unusual” from “harmful”?
Learning objectives¶
- Recognize common code, design, and architecture smells.
- Interpret threshold-based detectors critically.
- Compare structural, historical, and semantic evidence.
- Prioritize smells by maintenance risk rather than count.
Smell levels¶
- Code smells: Long Method, Feature Envy, Long Parameter List, Duplicated Code.
- Design smells: God Class, cyclic dependencies, unstable abstractions, inappropriate inheritance.
- Architecture smells: hub-like dependency, cyclic architecture, scattered functionality, ambiguous interfaces.
Detection model¶
A simple metric-based detector might define God Class as:
The research questions are immediately visible:
- How were thresholds chosen?
- Do they generalize across projects/languages?
- What is the oracle/ground truth?
- How much do experts agree?
- Does detected smell removal improve outcomes?
Prioritization¶
Severity can incorporate change frequency, defect history, ownership, centrality, test coverage, and refactoring cost—not only smell intensity.
Design / research exercise¶
Run two smell detectors or two threshold settings on the same project. Analyze disagreements manually. Classify disagreements as threshold effects, parser/modeling differences, or conceptual ambiguity.
Suggested reading¶
- Fowler, Refactoring (smells).
- Research on code/design smell detection and prioritization.