- Introduced by
- Martin Fowler and García et al.
- Year
- 2009
- Type
- pattern-based analysis
- Family
- Architecture assessment
What does it do?
Architecture smells are recurring design fragments in a software system's structure that can harm maintainability over the system's lifecycle.
García et al. (2009) introduced the concept of architectural bad smells and distinguished them from architectural antipatterns and code smells. Detection combines structural information such as dependency graphs with metric and pattern analysis, and the results guide refactoring and architectural review. The method is a procedural analysis pipeline rather than a formula-based calculation.
The intuition behind the method
Code smells point to poorly written code; architecture smells point to design fragments at the level of components and their dependencies, such as a module that many others depend on, or a set of modules that depend on one another in a cycle. A smell is a signal, not proof of a defect: it marks a design worth examining. Finding such signals early gives a team the chance to address them before their effects on maintenance accumulate.
History
Code smell concepts are associated with Fowler's refactoring work. García et al. (2009) introduced architectural bad smells, distinguished them from architectural antipatterns and code smells, and described four representative architectural smells found while reverse-engineering eighteen grid technologies and refactoring one large industrial system.
When to use it
Use architecture smell detection when an existing codebase can be analysed and the question concerns recurring structural problems: a periodic architecture review, a planned large refactoring, or a slowdown in development that may be linked to dependencies between components. It is also suited to identifying candidate boundaries when a monolith is considered for decomposition into services. Do not rely on it for greenfield designs that have no implementation to analyse, for judgements about the internal quality of a single class (code-level smell tools are more direct there), or as a substitute for understanding the business and team context of a flagged component.
Limitations and considerations
- Detection quality depends on the dependency graph extracted from code; static extraction can miss dependencies that exist only at runtime, such as those introduced through configuration or reflection.
- Language and framework conventions change what counts as a dependency, so the same design can be flagged differently across ecosystems.
- Smell definitions are not standardised across the literature, so different tools and studies may report different sets of architectural smells.
- Many smells are context-dependent; a flagged pattern may be a deliberate design choice and needs review by someone who knows the system.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Targets structure between components, such as dependency direction and cycles, which checks on individual classes do not examine.
- Produces a list of named structural patterns and the components they involve, giving architecture discussions a concrete starting point.
- Can be repeated as the dependency graph changes, so the same analysis can be compared across review cycles.
- Can point to components whose dependencies are concentrated enough to be candidates for separation, for example when considering service extraction.
Applications
- Identifying candidate components for extraction from a monolithic e-commerce platform, looking for components with strong internal cohesion and few dependencies on the rest of the system.
- Catching nascent dependency cycles between modules in a large enterprise application during architecture reviews, before they become harder to remove.
- Informing module and team boundaries in a scaling organisation by comparing architectural hotspots with areas where teams report repeated coordination work.
- Planning the modernisation of a legacy system by separating tightly coupled subsystems, which need intensive refactoring, from modular areas that could be replaced gradually.
How it works
How it works
Recover the system's architecture from its source code: build dependency graphs, identify package and module boundaries, and, where available, draw on version history and change logs.
Normalise the extracted dependencies into a common representation, identify logical components, and resolve indirect dependencies so that the graph reflects the structure a reviewer would examine. Architecture views, such as layered or component views, can then be built from this graph.
Look for structural indicators such as high fan-in or fan-out, cyclic dependencies between modules, and components that concentrate many responsibilities. The cited sources do not give universal numeric thresholds for these indicators, so cut-offs have to be calibrated for each system or tool. Confirm a candidate smell against at least one independent signal, such as a code metric or an architecture view, before acting on it, since a single indicator is not a diagnosis.
Group related candidate smells into higher-level issues and order them by likely impact on maintenance and by how widely they occur. No fixed scoring rule for impact or remediation effort is part of this method, so estimates depend on analyst judgement. Record the basis for each impact estimate, for example the components affected or how often they change, so that reviewers can check the prioritisation and repeat it in later reviews.
Present the architecture with the flagged components highlighted, and explain what each flagged dependency pattern implies for change and testing. Refactoring options include breaking dependencies, introducing layers or interfaces, and extracting components into separate services; the choice depends on the context of the flagged structure.
Common pitfalls
- Treating high coupling as a defect in itself. Coupling that reflects a deliberate performance or simplicity trade-off is not necessarily a design fault.
- Aiming for no architectural debt at all. Some coupling and layering violations are economically rational under delivery constraints, so the aim is to manage the ones that matter.
- Mistaking a smell for its cause. A flagged cycle shows where the structure is tangled, but not which dependency should be removed or how.
- Planning refactoring without the teams that own the components. Changing component boundaries usually requires coordination across the teams that build and deploy them.
Frequently asked questions
What are the most common architecture smells?
Names vary across the literature, so no single list is definitive. García et al. (2009) describe architectural bad smells as frequently recurring designs with non-obvious and significant detrimental effects on system lifecycle properties, and report four representative smells from reverse-engineering eighteen grid technologies and refactoring one large industrial system. Before comparing results, check the smell definitions used by the tool or study you are following.
How do I distinguish architecture smells from legitimate design patterns?
Context decides this. The same structure can be a pattern in one system and a smell in another. A structure such as a facade is justified when it hides complexity for a clear purpose; a smell arises when the design adds coupling or complexity without a corresponding benefit. If you cannot state what a structure is for, treat it as a smell to investigate.
How can I remove architecture smells without disrupting ongoing development?
Start with the smells whose effects on change are largest, and refactor in small steps. A common sequence is to introduce an abstraction, migrate dependencies to it gradually, and remove the old dependency once migration is complete. Assigning new features to the refactored modules ties the work to delivery, and the branch-by-abstraction pattern lets refactoring proceed behind feature flags.
Are all architecture smells harmful?
No. Some smells are deliberate trade-offs for performance, simplicity or business constraints; tight coupling between performance-critical modules can be justified. For each flagged smell, ask whether it enables a real requirement. If it does, record the reasoning so later reviewers know it was a choice; if it does not, prioritise it for remediation according to its impact.
Related methods
Sources
Fowler, M. (2018). Code smell. Martin Fowler's Website.
Open publication referenceGarcia, J., Popescu, D., Edwards, G., & Medvidovic, N. (2009). Identifying architectural bad smells. In Proceedings of the 2009 IEEE/IFIP Conference on Software Architecture (pp. 141–150).
Open DOI referenceLanza, M., & Marinescu, R. (2005). Object-Oriented Metrics in Practice. Springer.
Open publication reference