SlideShare a Scribd company logo
1 of 1
Download to read offline
Refactoring for Software Design Smells
Abst%action  
Missing  Abst%action  
This	
  smell	
  arises	
  when	
  clumps	
  of	
  data	
  or	
  
encoded	
  strings	
  are	
  used	
  instead	
  of	
  crea5ng	
  
a	
  class	
  or	
  an	
  interface.	
  
Imperative  Abst%action  
This	
  smell	
  arises	
  when	
  an	
  opera5on	
  is	
  
turned	
  into	
  a	
  class.	
  	
  
Incomplete  Abst%action  
This	
  smell	
  arises	
  when	
  an	
  abstrac5on	
  does	
  
not	
  support	
  complementary	
  or	
  interrelated	
  
methods	
  completely.	
  
Multifaceted  Abst%action  
This	
  smell	
  arises	
  when	
  an	
  abstrac5on	
  has	
  
more	
  than	
  one	
  responsibility	
  assigned	
  to	
  it.	
  
Unnecessar9  Abst%action  
This	
  smell	
  occurs	
  when	
  an	
  abstrac5on	
  which	
  
is	
  actually	
  not	
  needed	
  (and	
  thus	
  could	
  have	
  
been	
  avoided)	
  gets	
  introduced	
  in	
  a	
  so<ware	
  
design.	
  	
  
Unutilized  Abst%action  
This	
  smell	
  arises	
  when	
  an	
  abstrac5on	
  is	
  le<	
  
unused	
  (either	
  not	
  directly	
  used	
  or	
  not	
  
reachable).	
  
Duplicate  Abst%action  
This	
  smell	
  arises	
  when	
  two	
  or	
  more	
  
abstrac5ons	
  have	
  the	
  iden5cal	
  name	
  or	
  
iden5cal	
  implementa5on	
  or	
  both.	
  	
  
Encapsulation  
Deficient  Encapsulation  
This	
  smell	
  occurs	
  when	
  the	
  declared	
  accessibility	
  
of	
  one	
  or	
  more	
  members	
  of	
  an	
  abstrac5on	
  is	
  
more	
  permissive	
  than	
  actually	
  required.	
  
Leaky  Encapsulation  
This	
  smell	
  arises	
  when	
  an	
  abstrac5on	
  “exposes”	
  
or	
  “leaks”	
  implementa5on	
  details	
  through	
  its	
  
public	
  interface.	
  
Missing  Encapsulation  
This	
  smell	
  occurs	
  when	
  the	
  encapsula5on	
  of	
  
implementa5on	
  varia5ons	
  in	
  a	
  type	
  or	
  hierarchy	
  
is	
  missing.	
  
UnexBloited  Encapsulation  
This	
  smell	
  arises	
  when	
  client	
  code	
  uses	
  explicit	
  
type	
  checks(using	
  chained	
  if-­‐else	
  or	
  switch	
  
statements)	
  instead	
  of	
  exploi5ng	
  the	
  varia5on	
  in	
  
types	
  already	
  encapsulated	
  within	
  a	
  hierarchy.	
  
Modularization  
Broken  Modularization  
This	
  smell	
  arises	
  when	
  data	
  and/or	
  methods	
  
that	
  ideally	
  should	
  have	
  been	
  localized	
  into	
  a	
  
single	
  abstrac5on	
  are	
  separated	
  and	
  spread	
  
across	
  mul5ple	
  abstrac5ons.	
  
Insufficient  Modularization  
This	
  smell	
  arises	
  when	
  an	
  abstrac5on	
  exists	
  that	
  
has	
  not	
  been	
  completely	
  decomposed	
  and	
  a	
  
further	
  decomposi5on	
  could	
  reduce	
  its	
  size,	
  
implementa5on	
  complexity,	
  or	
  both.	
  	
  
Cyclically-­‐  dependent  
Modularization  This	
  smell	
  arises	
  when	
  two	
  or	
  more	
  abstrac5ons	
  
depend	
  on	
  each	
  other	
  directly	
  or	
  indirectly	
  
(crea5ng	
  a	
  5ght	
  coupling	
  between	
  the	
  
abstrac5ons).	
  	
  
Hub-­‐like  Modularization  
This	
  smell	
  arises	
  when	
  an	
  abstrac5on	
  has	
  
dependencies	
  (both	
  incoming	
  and	
  outgoing)	
  
with	
  large	
  number	
  of	
  other	
  abstrac5ons.	
  
Hierarchy  
Missing  Hierarchy  
This	
  smell	
  arises	
  when	
  a	
  code	
  segment	
  uses	
  
condi5onal	
  logic	
  (typically	
  in	
  conjunc5on	
  with	
  
“tagged	
  types”)	
  to	
  explicitly	
  manage	
  varia5on	
  in	
  
behavior	
  where	
  a	
  hierarchy	
  could	
  have	
  been	
  
created	
  and	
  used	
  to	
  encapsulate	
  those	
  
varia5ons.	
  	
  
Unnecessar9  Hierarchy  
This	
  smell	
  arises	
  when	
  the	
  whole	
  inheritance	
  
hierarchy	
  is	
  unnecessary,	
  indica5ng	
  that	
  
inheritance	
  has	
  been	
  applied	
  needlessly	
  for	
  the	
  
par5cular	
  design	
  context.	
  	
  
Unfactored  Hierarchy  
This	
  smell	
  arises	
  when	
  there	
  is	
  unnecessary	
  
duplica5on	
  among	
  types	
  in	
  the	
  hierarchy.	
  
Wide  Hierarchy  
This	
  smell	
  arises	
  when	
  an	
  inheritance	
  hierarchy	
  
is	
  “too”	
  wide	
  indica5ng	
  that	
  intermediate	
  
abstrac5ons	
  may	
  be	
  missing.	
  	
  
Speculative  Hierarchy  
This	
  smell	
  arises	
  when	
  one	
  or	
  more	
  types	
  in	
  a	
  
hierarchy	
  are	
  provided	
  specula5vely	
  (i.e.	
  based	
  
on	
  imagined	
  needs	
  rather	
  than	
  real	
  
requirements).	
  
Deep  Hierarchy  
This	
  smell	
  arises	
  when	
  an	
  inheritance	
  hierarchy	
  
is	
  "excessively"	
  deep.	
  	
  
Rebellious  Hierarchy  
This	
  smell	
  arises	
  when	
  a	
  subtype	
  rejects	
  the	
  
methods	
  provided	
  by	
  its	
  supertype(s).	
  	
  
Broken  Hierarchy  
This	
  smell	
  arises	
  when	
  a	
  supertype	
  and	
  its	
  
subtype	
  conceptually	
  do	
  not	
  share	
  an	
  “IS-­‐A”	
  
rela5onship	
  resul5ng	
  in	
  broken	
  subs5tutability.	
  	
  
Multipath  Hierarchy  
This	
  smell	
  arises	
  when	
  a	
  subtype	
  inherits	
  both	
  
directly	
  as	
  well	
  as	
  indirectly	
  from	
  a	
  supertype	
  
leading	
  to	
  unnecessary	
  inheritance	
  paths	
  in	
  the	
  
hierarchy.	
  	
  
Cyclic  Hierarchy  
This	
  smell	
  arises	
  when	
  a	
  supertype	
  in	
  a	
  
hierarchy	
  depends	
  on	
  any	
  of	
  its	
  subtypes.	
  	
  
“Refactoring  for  SoſtNare  DesigO  Smells:  
Managing  Technical  Debt”,  Girish  
Sur9anarayana,  Ganesh  SamarUhyam,  
Tushar  SharVa,  ISBN:  978-­‐0128013977,  
Morgan  KaufVann/Elsevier,  2014  
  
hbB://amzn.com/0128013974  

More Related Content

Viewers also liked

Lei de Demeter parte
Lei de Demeter parteLei de Demeter parte
Lei de Demeter parte
Jorge Oleques
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
Sanjeev Patel
 

Viewers also liked (10)

Decomposing Object oriented class
Decomposing Object oriented classDecomposing Object oriented class
Decomposing Object oriented class
 
Codesmells for AspectJ
Codesmells for AspectJCodesmells for AspectJ
Codesmells for AspectJ
 
Lei de Demeter parte
Lei de Demeter parteLei de Demeter parte
Lei de Demeter parte
 
Detecting Bad Smells in Source Code using Change History Information
Detecting Bad Smells in Source Code using Change History InformationDetecting Bad Smells in Source Code using Change History Information
Detecting Bad Smells in Source Code using Change History Information
 
Bad smells no código
Bad smells no códigoBad smells no código
Bad smells no código
 
When and Why Your Code Starts to Smell Bad
When and Why Your Code Starts to Smell BadWhen and Why Your Code Starts to Smell Bad
When and Why Your Code Starts to Smell Bad
 
Do They Really Smell Bad? A Study on Developers' Perception of Bad Code Smells
Do They Really Smell Bad? A Study on Developers' Perception of Bad Code SmellsDo They Really Smell Bad? A Study on Developers' Perception of Bad Code Smells
Do They Really Smell Bad? A Study on Developers' Perception of Bad Code Smells
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
 
Bad Smell in Codes - Part 1
Bad Smell in Codes - Part 1Bad Smell in Codes - Part 1
Bad Smell in Codes - Part 1
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
 

More from Ganesh Samarthyam

More from Ganesh Samarthyam (20)

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

Recently uploaded

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 

Refactoring for design smells - concise poster

  • 1. Refactoring for Software Design Smells Abst%action   Missing  Abst%action   This  smell  arises  when  clumps  of  data  or   encoded  strings  are  used  instead  of  crea5ng   a  class  or  an  interface.   Imperative  Abst%action   This  smell  arises  when  an  opera5on  is   turned  into  a  class.     Incomplete  Abst%action   This  smell  arises  when  an  abstrac5on  does   not  support  complementary  or  interrelated   methods  completely.   Multifaceted  Abst%action   This  smell  arises  when  an  abstrac5on  has   more  than  one  responsibility  assigned  to  it.   Unnecessar9  Abst%action   This  smell  occurs  when  an  abstrac5on  which   is  actually  not  needed  (and  thus  could  have   been  avoided)  gets  introduced  in  a  so<ware   design.     Unutilized  Abst%action   This  smell  arises  when  an  abstrac5on  is  le<   unused  (either  not  directly  used  or  not   reachable).   Duplicate  Abst%action   This  smell  arises  when  two  or  more   abstrac5ons  have  the  iden5cal  name  or   iden5cal  implementa5on  or  both.     Encapsulation   Deficient  Encapsulation   This  smell  occurs  when  the  declared  accessibility   of  one  or  more  members  of  an  abstrac5on  is   more  permissive  than  actually  required.   Leaky  Encapsulation   This  smell  arises  when  an  abstrac5on  “exposes”   or  “leaks”  implementa5on  details  through  its   public  interface.   Missing  Encapsulation   This  smell  occurs  when  the  encapsula5on  of   implementa5on  varia5ons  in  a  type  or  hierarchy   is  missing.   UnexBloited  Encapsulation   This  smell  arises  when  client  code  uses  explicit   type  checks(using  chained  if-­‐else  or  switch   statements)  instead  of  exploi5ng  the  varia5on  in   types  already  encapsulated  within  a  hierarchy.   Modularization   Broken  Modularization   This  smell  arises  when  data  and/or  methods   that  ideally  should  have  been  localized  into  a   single  abstrac5on  are  separated  and  spread   across  mul5ple  abstrac5ons.   Insufficient  Modularization   This  smell  arises  when  an  abstrac5on  exists  that   has  not  been  completely  decomposed  and  a   further  decomposi5on  could  reduce  its  size,   implementa5on  complexity,  or  both.     Cyclically-­‐  dependent   Modularization  This  smell  arises  when  two  or  more  abstrac5ons   depend  on  each  other  directly  or  indirectly   (crea5ng  a  5ght  coupling  between  the   abstrac5ons).     Hub-­‐like  Modularization   This  smell  arises  when  an  abstrac5on  has   dependencies  (both  incoming  and  outgoing)   with  large  number  of  other  abstrac5ons.   Hierarchy   Missing  Hierarchy   This  smell  arises  when  a  code  segment  uses   condi5onal  logic  (typically  in  conjunc5on  with   “tagged  types”)  to  explicitly  manage  varia5on  in   behavior  where  a  hierarchy  could  have  been   created  and  used  to  encapsulate  those   varia5ons.     Unnecessar9  Hierarchy   This  smell  arises  when  the  whole  inheritance   hierarchy  is  unnecessary,  indica5ng  that   inheritance  has  been  applied  needlessly  for  the   par5cular  design  context.     Unfactored  Hierarchy   This  smell  arises  when  there  is  unnecessary   duplica5on  among  types  in  the  hierarchy.   Wide  Hierarchy   This  smell  arises  when  an  inheritance  hierarchy   is  “too”  wide  indica5ng  that  intermediate   abstrac5ons  may  be  missing.     Speculative  Hierarchy   This  smell  arises  when  one  or  more  types  in  a   hierarchy  are  provided  specula5vely  (i.e.  based   on  imagined  needs  rather  than  real   requirements).   Deep  Hierarchy   This  smell  arises  when  an  inheritance  hierarchy   is  "excessively"  deep.     Rebellious  Hierarchy   This  smell  arises  when  a  subtype  rejects  the   methods  provided  by  its  supertype(s).     Broken  Hierarchy   This  smell  arises  when  a  supertype  and  its   subtype  conceptually  do  not  share  an  “IS-­‐A”   rela5onship  resul5ng  in  broken  subs5tutability.     Multipath  Hierarchy   This  smell  arises  when  a  subtype  inherits  both   directly  as  well  as  indirectly  from  a  supertype   leading  to  unnecessary  inheritance  paths  in  the   hierarchy.     Cyclic  Hierarchy   This  smell  arises  when  a  supertype  in  a   hierarchy  depends  on  any  of  its  subtypes.     “Refactoring  for  SoſtNare  DesigO  Smells:   Managing  Technical  Debt”,  Girish   Sur9anarayana,  Ganesh  SamarUhyam,   Tushar  SharVa,  ISBN:  978-­‐0128013977,   Morgan  KaufVann/Elsevier,  2014     hbB://amzn.com/0128013974