SlideShare a Scribd company logo
Refactoring	for	Architecture	Smells:	
An	Introduction	
“Cities grow, cities evolve, cities have parts that simply die while other parts flourish; each
city has to be renewed in order to meet the needs of its populace…
Software-intensive systems are like that.”
- Grady Booch
“Code smells” or “bad smells” [1] are considered structures or code fragments that
indicate deeper problems in code and suggest the possibility of refactoring. Refactoring [1]
is the technique to eliminate smells and is defined as behavior-preserving program
transformations.
In general, smells and their corresponding refactorings are applied at various granularity
levels of abstraction. Smells could be categorized as implementation smells [1], design
smells [2], and architecture smells [3]. How do we decide whether a smell is an
implementation, design, or architecture smell? It is based on the characteristics, scope,
and the impact of the smell. Implementation smells have limited scope (typically confined
to a class (or file)) and have a limited local impact. On the other hand, architecture smells
span to multiple components, have a system level impact. Because smells differ in their
scope, impact, and effort required for refactoring, it is pragmatic to classify the smells into
implementation, design, and architecture smells. Similar to smells, refactoring techniques
applied to refactor these smells can also be classified as implementation refactoring [1],
design refactoring [2], and architecture refactoring [3].
In this article, we focus on architecture smells and architecture refactoring. We can borrow
and extrapolate the definition of code and design smell to define architecture smells.
Architecture smells are architecture decisions or structures that “negatively impact system
quality” [4]. On the similar lines, architecture refactoring can be considered as semantic-
preserving architectural transformations for addressing architecture smells [5].
Figure 1. Refactoring for “skipped layer” smell
Let us consider an example of architecture smell from an industrial project. In this case,
one of the architectural components of the application is a Data Access Layer (DAL). The
architectural decision made earlier with respect to DAL in the software is that all the
accesses to the database (Oracle) must be made only through the DAL. The project
roadmap had plans to support other databases such as MySQL and MS SQL as well in the
upcoming releases. However, developers introduced numerous SQL queries that directly
accessed the database skipping the DAL either due to negligence or due to lack of
appropriate knowledge transfer of the architectural decision. This “skipped layer” smell
affects the flexibility of the architecture (in supporting new databases) and hence
negatively affects system quality. The project team had to later refactor the SQL queries
and route the calls through the DAL when they needed to support MySQL and MS SQL
databases in the later releases. The name of the smell, that occurred in this case, is
“skipped layer” smell which required an architecture refactoring to enforce the original
architecture decision of directing the data access calls through DAL layer (see Figure 1).
Another very commonly known architecture smell is “Cyclic dependencies between
packages”. For instance, consider extensive cyclic dependencies between packages in the
java.lang package (Figure 2); the figure is generated from “Structure 101 for Java (version
4.1)”. The packages involved in the cycle have to be used, reused, tested, and deployed
together. For this reason, this smell negatively affects maintainability, reusability,
testability, reliability, and deployability of the software.
There are many options for refactoring such cyclic dependencies:
• Break one of the dependencies (by removing unused classes or part of the classes
responsible for the dependency to the other package)
• Change the dependency direction (by moving classes or part of the classes)
• Extract another package from one of the packages to a new package in such a way that
the cyclic dependency breaks.
Figure 2. Cyclic dependencies between packages in java.lang package
Apart from the discussed examples of architecture smells, there are many commonly
known architecture smells such as “complex package” and “back layer call”.
There are many important reasons for performing architecture refactoring. Let us examine
one of the very prominent reasons here. When architecture debt [6] accumulates, the
clear impact of the debt is felt in the form of reduced productivity and reduced agility –
i.e., the team is unable to keep up with increasing customer needs and the number of
features delivered by the team reduces over time. Most often, the problem is due to lack
of refactoring as part of the development process that manifests as architecture and
design decay. The system becomes brittle – adding one feature requires touching many
components and those changes have ripple effects and results in breaking other
components. Performing architecture and design refactoring helps repay debt, enables
agility, and gets the project on track.
Figure 3. Refactoring by breaking cyclic dependencies between packages
In summary, architecture smells are architecture decisions or structures that negatively
impact software qualities. Architecture refactoring is semantic-preserving architectural
transformations for addressing architecture smells. Performing architecture refactoring
enables agility and helps keep architecture debt under control.
This article is available online at: http://www.designsmells.com/articledetail/15
References:
1. Martin Fowler, “Refactoring: Improving the Design of Existing Code”, Addison-Wesley,
1999.
2. Girish Suryanarayana, Ganesh Samarthyam, and Tushar Sharma, “Refactoring for
Software Design Smells: Managing Technical Debt”, Morgan Kaufmann/Elsevier, 2014.
3. Michael Stal, “Software Architecture Refactoring”, Tutorial in the International
Conference on Object Oriented Programming, Systems, Languages and Applications
(OOPSLA), 2007.
4. Joshua Garcia, Daniel Popescu, George Edwards, and Nenad Medvidovic, “Identifying
Architectural Bad Smells”, European Conference on Software Maintenance and
Reengineering (CSMR '09), 2009.
5. Michael Stal, “Architecture Refactoring”. Available online at:
http://stal.blogspot.com/2007/01/architecture-refactoring.html [last accessed on 8-
Nov-2015]
6. Ipek Ozkaya, “Strategic Management of Architectural Technical Debt”, SEI Agile
Research Forum, 2012. Available online at:
http://www.sei.cmu.edu/library/abstracts/webinars/Strategic-Management-of-
Architectural-Technical-Debt.cfm [Last accessed: 9-Nov-2015]

More Related Content

PDF
Software Architecture connectors - ActiveMQ analysis
PDF
Full Paper
PDF
software architecture
PDF
Solid Principles, for better cohesion and lower coupling
PPTX
Overview of DoDAF with Innoslate
PPT
PDF
Software Architectural mismatches
PPTX
Software evolution and maintenance basic concepts and preliminaries
Software Architecture connectors - ActiveMQ analysis
Full Paper
software architecture
Solid Principles, for better cohesion and lower coupling
Overview of DoDAF with Innoslate
Software Architectural mismatches
Software evolution and maintenance basic concepts and preliminaries

What's hot (20)

PPTX
Software Evolution and Maintenance Models
PPTX
PPT
Socio Technical Systems in Software Engineering SE2
PDF
Software Engineering Important Short Question for Exams
PDF
Oop final project documentation jose pagan v2.1
PPTX
Quality attributes in software architecture by Dr.C.R.Dhivyaa, Assistant prof...
PPT
Architecture design in software engineering
PPT
Configuration Management in Software Engineering - SE29
PPTX
Software Reengineering
PPT
5 software design
DOCX
Mi0033 software engineering
PPT
Slides 6 design of sw arch using add
PPT
Chapter1
PDF
Software Designing - Software Engineering
PPTX
PPTX
Architectural styles and patterns
PPTX
software re-engineering
PPTX
Software Engineering
DOCX
Unit i software design principles 9
PDF
SE2018_Lec 21_ Software Configuration Management (SCM)
Software Evolution and Maintenance Models
Socio Technical Systems in Software Engineering SE2
Software Engineering Important Short Question for Exams
Oop final project documentation jose pagan v2.1
Quality attributes in software architecture by Dr.C.R.Dhivyaa, Assistant prof...
Architecture design in software engineering
Configuration Management in Software Engineering - SE29
Software Reengineering
5 software design
Mi0033 software engineering
Slides 6 design of sw arch using add
Chapter1
Software Designing - Software Engineering
Architectural styles and patterns
software re-engineering
Software Engineering
Unit i software design principles 9
SE2018_Lec 21_ Software Configuration Management (SCM)
Ad

Viewers also liked (6)

PDF
Refactoring for software design smells - icse 2014 tutorial
PDF
Architecture refactoring - accelerating business success
PDF
Refactoring for Software Architecture Smells - International Workshop on Refa...
PPT
agile architecture - two hour presentation - two worked examples
PDF
Refactoring for Software Architecture Smells
PPTX
Refactoring, Emergent Design & Evolutionary Architecture
Refactoring for software design smells - icse 2014 tutorial
Architecture refactoring - accelerating business success
Refactoring for Software Architecture Smells - International Workshop on Refa...
agile architecture - two hour presentation - two worked examples
Refactoring for Software Architecture Smells
Refactoring, Emergent Design & Evolutionary Architecture
Ad

Similar to Refactoring for architecture smells an introduction (20)

PDF
ARCHITECTING IN THE CONTEXT OF AGILE SOFTWARE DEVELOPMENT: FRAGILITY VERSUS F...
PDF
ARCHITECTING IN THE CONTEXT OF AGILE SOFTWARE DEVELOPMENT: FRAGILITY VERSUS F...
PDF
Articulo acm
PDF
Software Architecture Erosion: Impacts, Causes, and Management
PPTX
SA_UNIT_1.pptx
PDF
Object oriented analysis and design unit- v
DOC
Lecture-_-5-_SDA_software design and architecture.doc
PPTX
UNIT3 PART2.pptx dhfdifhdsfvgudf dhfbdhbffdvf
PPTX
Unit2 2
PPTX
Reusability Vs Extensibility and Methodologies in OOAD
DOCX
Software architecture Unit 1 notes
PDF
Design Engineering is a topic of software engineering of second year fourth s...
DOC
Unit-3.doc
PDF
Lectura 2.1 architectural integrationstylesfor largescale-editable_pdf
PDF
Ports adapters architecture (hexagonal architecture)
PDF
Quality Attributes and Software Architectures Emerging Through Agile Developm...
PDF
GENERATING SOFTWARE PRODUCT LINE MODEL BY RESOLVING CODE SMELLS IN THE PRODUC...
PDF
Generating Software Product Line Model by Resolving Code Smells in the Produc...
PDF
GENERATING SOFTWARE PRODUCT LINE MODEL BY RESOLVING CODE SMELLS IN THE PRODUC...
PDF
A Comparative Study of Forward and Reverse Engineering
ARCHITECTING IN THE CONTEXT OF AGILE SOFTWARE DEVELOPMENT: FRAGILITY VERSUS F...
ARCHITECTING IN THE CONTEXT OF AGILE SOFTWARE DEVELOPMENT: FRAGILITY VERSUS F...
Articulo acm
Software Architecture Erosion: Impacts, Causes, and Management
SA_UNIT_1.pptx
Object oriented analysis and design unit- v
Lecture-_-5-_SDA_software design and architecture.doc
UNIT3 PART2.pptx dhfdifhdsfvgudf dhfbdhbffdvf
Unit2 2
Reusability Vs Extensibility and Methodologies in OOAD
Software architecture Unit 1 notes
Design Engineering is a topic of software engineering of second year fourth s...
Unit-3.doc
Lectura 2.1 architectural integrationstylesfor largescale-editable_pdf
Ports adapters architecture (hexagonal architecture)
Quality Attributes and Software Architectures Emerging Through Agile Developm...
GENERATING SOFTWARE PRODUCT LINE MODEL BY RESOLVING CODE SMELLS IN THE PRODUC...
Generating Software Product Line Model by Resolving Code Smells in the Produc...
GENERATING SOFTWARE PRODUCT LINE MODEL BY RESOLVING CODE SMELLS IN THE PRODUC...
A Comparative Study of Forward and Reverse Engineering

More from Ganesh Samarthyam (20)

PDF
Wonders of the Sea
PDF
Animals - for kids
PDF
Applying Refactoring Tools in Practice
PDF
CFP - 1st Workshop on “AI Meets Blockchain”
PDF
Great Coding Skills Aren't Enough
PDF
College Project - Java Disassembler - Description
PDF
Coding Guidelines - Crafting Clean Code
PDF
Design Patterns - Compiler Case Study - Hands-on Examples
PDF
Bangalore Container Conference 2017 - Brief Presentation
PDF
Bangalore Container Conference 2017 - Poster
PDF
Software Design in Practice (with Java examples)
PDF
OO Design and Design Patterns in C++
PDF
Bangalore Container Conference 2017 - Sponsorship Deck
PDF
Let's Go: Introduction to Google's Go Programming Language
PPT
Google's Go Programming Language - Introduction
PDF
Java Generics - Quiz Questions
PDF
Java Generics - by Example
PDF
Software Architecture - Quiz Questions
PDF
Docker by Example - Quiz
PDF
Core Java: Best practices and bytecodes quiz
Wonders of the Sea
Animals - for kids
Applying Refactoring Tools in Practice
CFP - 1st Workshop on “AI Meets Blockchain”
Great Coding Skills Aren't Enough
College Project - Java Disassembler - Description
Coding Guidelines - Crafting Clean Code
Design Patterns - Compiler Case Study - Hands-on Examples
Bangalore Container Conference 2017 - Brief Presentation
Bangalore Container Conference 2017 - Poster
Software Design in Practice (with Java examples)
OO Design and Design Patterns in C++
Bangalore Container Conference 2017 - Sponsorship Deck
Let's Go: Introduction to Google's Go Programming Language
Google's Go Programming Language - Introduction
Java Generics - Quiz Questions
Java Generics - by Example
Software Architecture - Quiz Questions
Docker by Example - Quiz
Core Java: Best practices and bytecodes quiz

Recently uploaded (20)

PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
Essential Infomation Tech presentation.pptx
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
Introduction to Artificial Intelligence
PDF
Digital Strategies for Manufacturing Companies
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
AI in Product Development-omnex systems
PDF
Understanding Forklifts - TECH EHS Solution
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
Nekopoi APK 2025 free lastest update
PPTX
Transform Your Business with a Software ERP System
PPTX
Odoo POS Development Services by CandidRoot Solutions
PPTX
ai tools demonstartion for schools and inter college
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
How to Choose the Right IT Partner for Your Business in Malaysia
Essential Infomation Tech presentation.pptx
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Introduction to Artificial Intelligence
Digital Strategies for Manufacturing Companies
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
AI in Product Development-omnex systems
Understanding Forklifts - TECH EHS Solution
How to Migrate SBCGlobal Email to Yahoo Easily
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
2025 Textile ERP Trends: SAP, Odoo & Oracle
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Nekopoi APK 2025 free lastest update
Transform Your Business with a Software ERP System
Odoo POS Development Services by CandidRoot Solutions
ai tools demonstartion for schools and inter college

Refactoring for architecture smells an introduction

  • 1. Refactoring for Architecture Smells: An Introduction “Cities grow, cities evolve, cities have parts that simply die while other parts flourish; each city has to be renewed in order to meet the needs of its populace… Software-intensive systems are like that.” - Grady Booch “Code smells” or “bad smells” [1] are considered structures or code fragments that indicate deeper problems in code and suggest the possibility of refactoring. Refactoring [1] is the technique to eliminate smells and is defined as behavior-preserving program transformations. In general, smells and their corresponding refactorings are applied at various granularity levels of abstraction. Smells could be categorized as implementation smells [1], design smells [2], and architecture smells [3]. How do we decide whether a smell is an implementation, design, or architecture smell? It is based on the characteristics, scope, and the impact of the smell. Implementation smells have limited scope (typically confined to a class (or file)) and have a limited local impact. On the other hand, architecture smells span to multiple components, have a system level impact. Because smells differ in their scope, impact, and effort required for refactoring, it is pragmatic to classify the smells into implementation, design, and architecture smells. Similar to smells, refactoring techniques applied to refactor these smells can also be classified as implementation refactoring [1], design refactoring [2], and architecture refactoring [3]. In this article, we focus on architecture smells and architecture refactoring. We can borrow and extrapolate the definition of code and design smell to define architecture smells. Architecture smells are architecture decisions or structures that “negatively impact system quality” [4]. On the similar lines, architecture refactoring can be considered as semantic- preserving architectural transformations for addressing architecture smells [5]. Figure 1. Refactoring for “skipped layer” smell
  • 2. Let us consider an example of architecture smell from an industrial project. In this case, one of the architectural components of the application is a Data Access Layer (DAL). The architectural decision made earlier with respect to DAL in the software is that all the accesses to the database (Oracle) must be made only through the DAL. The project roadmap had plans to support other databases such as MySQL and MS SQL as well in the upcoming releases. However, developers introduced numerous SQL queries that directly accessed the database skipping the DAL either due to negligence or due to lack of appropriate knowledge transfer of the architectural decision. This “skipped layer” smell affects the flexibility of the architecture (in supporting new databases) and hence negatively affects system quality. The project team had to later refactor the SQL queries and route the calls through the DAL when they needed to support MySQL and MS SQL databases in the later releases. The name of the smell, that occurred in this case, is “skipped layer” smell which required an architecture refactoring to enforce the original architecture decision of directing the data access calls through DAL layer (see Figure 1). Another very commonly known architecture smell is “Cyclic dependencies between packages”. For instance, consider extensive cyclic dependencies between packages in the java.lang package (Figure 2); the figure is generated from “Structure 101 for Java (version 4.1)”. The packages involved in the cycle have to be used, reused, tested, and deployed together. For this reason, this smell negatively affects maintainability, reusability, testability, reliability, and deployability of the software. There are many options for refactoring such cyclic dependencies: • Break one of the dependencies (by removing unused classes or part of the classes responsible for the dependency to the other package) • Change the dependency direction (by moving classes or part of the classes) • Extract another package from one of the packages to a new package in such a way that the cyclic dependency breaks.
  • 3. Figure 2. Cyclic dependencies between packages in java.lang package Apart from the discussed examples of architecture smells, there are many commonly known architecture smells such as “complex package” and “back layer call”. There are many important reasons for performing architecture refactoring. Let us examine one of the very prominent reasons here. When architecture debt [6] accumulates, the clear impact of the debt is felt in the form of reduced productivity and reduced agility – i.e., the team is unable to keep up with increasing customer needs and the number of features delivered by the team reduces over time. Most often, the problem is due to lack of refactoring as part of the development process that manifests as architecture and design decay. The system becomes brittle – adding one feature requires touching many components and those changes have ripple effects and results in breaking other components. Performing architecture and design refactoring helps repay debt, enables agility, and gets the project on track.
  • 4. Figure 3. Refactoring by breaking cyclic dependencies between packages In summary, architecture smells are architecture decisions or structures that negatively impact software qualities. Architecture refactoring is semantic-preserving architectural transformations for addressing architecture smells. Performing architecture refactoring enables agility and helps keep architecture debt under control. This article is available online at: http://www.designsmells.com/articledetail/15 References: 1. Martin Fowler, “Refactoring: Improving the Design of Existing Code”, Addison-Wesley, 1999. 2. Girish Suryanarayana, Ganesh Samarthyam, and Tushar Sharma, “Refactoring for Software Design Smells: Managing Technical Debt”, Morgan Kaufmann/Elsevier, 2014. 3. Michael Stal, “Software Architecture Refactoring”, Tutorial in the International Conference on Object Oriented Programming, Systems, Languages and Applications (OOPSLA), 2007. 4. Joshua Garcia, Daniel Popescu, George Edwards, and Nenad Medvidovic, “Identifying Architectural Bad Smells”, European Conference on Software Maintenance and Reengineering (CSMR '09), 2009. 5. Michael Stal, “Architecture Refactoring”. Available online at: http://stal.blogspot.com/2007/01/architecture-refactoring.html [last accessed on 8- Nov-2015] 6. Ipek Ozkaya, “Strategic Management of Architectural Technical Debt”, SEI Agile Research Forum, 2012. Available online at: http://www.sei.cmu.edu/library/abstracts/webinars/Strategic-Management-of- Architectural-Technical-Debt.cfm [Last accessed: 9-Nov-2015]