SlideShare a Scribd company logo
1 of 24
Download to read offline
REFACTORING
Mnats Karakhanyan


Senior iOS Developer at Buymie


Smart Talk June


June 30 2022
WHAT IS REFACTORING
Refactoring is the process of changing a
software system in a way that does not
alter the external behavior of the code yet
improves its internal structure
WHY SHOULD WE REFACTOR
• Refactoring Improves the Design of Software


• Refactoring Makes Software Easier to Understand


• Refactoring Helps Find Bugs


• Refactoring Helps Program Faster
WHY SHOULD WE REFACTOR
“I’m not a great programmer; I’m
just a good programmer with great
habits.”


Kent Beck
WHY SHOULD WE REFACTOR
• Quality


• Clean code


• Profesionalizm


• Right Thing
WHY SHOULD WE REFACTOR
• Quality


• Clean code


• Profesionalizm


• Right Thing
Economy
THE TWO HATS
• Adding Functionality


• Refactoring
WORKFLOWS OF REFACTORING
• TTD Refactoring


• Litter-Pickup Refactoring


• Comprehension Refactoring


• Preparatory Refactoring


• Planned Refactoring


• Long Term Refactoring
BAD SMELLS IN CODE
Indications that there is trouble that
can be solved by a refactoring
BAD SMELLS IN CODE
• Mysterious Name


• Duplicated Code


• Long Function


• Long Parameter List


• Global Data


• Mutable Data


• Divergent Change


• Shotgun Surgery


• Feature Envy
• Middle Man


• Insider Trading


• Large Class


• Alternative Classes with
Different Interfaces


• Data Class


• Refused Bequest


• Comments
• Data Clumps


• Primitive Obsession


• Repeated Switches


• Loops


• Lazy Element


• Speculative Generality


• Temporary Field


• Message Chains
BAD SMELLS IN CODE
• Mysterious Name


• Duplicated Code


• Long Function


• Long Parameter List


• Global Data


• Mutable Data


• Divergent Change


• Shotgun Surgery


• Feature Envy
• Middle Man


• Insider Trading


• Large Class


• Alternative Classes with
Different Interfaces


• Data Class


• Refused Bequest


• Comments
• Data Clumps


• Primitive Obsession


• Repeated Switches


• Loops


• Lazy Element


• Speculative Generality


• Temporary Field


• Message Chains
BLOATERS
Bloaters are code, methods and classes
that have increased to such gargantuan
proportions that they are hard to work with.
Usually accumulate over time
BLOATERS
• Primitive Obsession


• Data Clumps


• Large Class


• Long Parameter List


• Long Function
OBJECT-ORIENTATION ABUSERS
Object Oriented concept not fully
understood and utilized
OBJECT-ORIENTATION ABUSERS
• Temporary Field


• Repeated Switches


• Alternative Classes with


Different Interfaces


• Refused Bequest
CHANGE PREVENTERS
Make changing the system unnecessarily
difficult
CHANGE PREVENTERS
• Shotgun Surgery


• Divergent Change
DISPENSABLES
Something pointless and unneeded whose
absence would make the code cleaner,
more efficient and easier to understand.
DISPENSABLES
• Lazy Element (Dead code)


• Speculative Generality


• Duplicated Code


• Data Class
COUPLERS
Low coupling between objects/classes is
one thedesirable goals of OO software
COUPLERS
• Feature Envy


• Message Chains


• Middle Man


• Insider Trading
EXAMPLE RECIPE
• If you can obtain one parameter by asking another parameter for it, you can use Replace
Parameter with Query


• Rather than pulling lots of data out of an existing data structure, you can use Preserve Whole
Object


• If several parameters always fit together, combine them with Introduce Parameter Object


• If a parameter is used as a flag to dispatch different behavior, use Remove Flag Argument


• when multiple functions share several parameter values. Then, you can use Combine
Functions into Class
Long Parameter List
BIBLIOGRAPHY
Refactoring Improving the Design of Existing Code


by Martin Fowler, with Kent Beck


Clean Code: A Handbook of Agile Software Craftsmanship


by Robert C. Martin


The Pragmatic Programmer: From Journeyman to Master


by Andy Hunt


Head First Design Patterns


by Eric Freeman
THANK YOU

More Related Content

Similar to Refactoring.pdf

Code qualityCode qualityCode quality.pptx
Code qualityCode qualityCode quality.pptxCode qualityCode qualityCode quality.pptx
Code qualityCode qualityCode quality.pptxSanjarMadraximov
 
Алексей Веркеенко "Symfony2 & REST API"
Алексей Веркеенко "Symfony2 & REST API" Алексей Веркеенко "Symfony2 & REST API"
Алексей Веркеенко "Symfony2 & REST API" Fwdays
 
Client Technical Analysis of Legacy Software and Future Replacement
Client Technical Analysis of Legacy Software and Future ReplacementClient Technical Analysis of Legacy Software and Future Replacement
Client Technical Analysis of Legacy Software and Future ReplacementVictorSzoltysek
 
Software Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuableSoftware Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuableComsysto Reply GmbH
 
Deep Dive into the Idea of Software Architecture
Deep Dive into the Idea of Software ArchitectureDeep Dive into the Idea of Software Architecture
Deep Dive into the Idea of Software ArchitectureMatthew Clarke
 
Metric driven refactoring
Metric driven refactoringMetric driven refactoring
Metric driven refactoringNick Harrison
 
Architecture Principles CodeStock
Architecture Principles CodeStock Architecture Principles CodeStock
Architecture Principles CodeStock Steve Barbour
 
Coding Standard And Code Review
Coding Standard And Code ReviewCoding Standard And Code Review
Coding Standard And Code ReviewMilan Vukoje
 
Ekon20 mORMot Legacy Code Technical Debt Delphi Conference
Ekon20 mORMot Legacy Code Technical Debt Delphi Conference Ekon20 mORMot Legacy Code Technical Debt Delphi Conference
Ekon20 mORMot Legacy Code Technical Debt Delphi Conference Arnaud Bouchez
 
From ddd to DDD : My journey from data-driven development to Domain-Driven De...
From ddd to DDD : My journey from data-driven development to Domain-Driven De...From ddd to DDD : My journey from data-driven development to Domain-Driven De...
From ddd to DDD : My journey from data-driven development to Domain-Driven De...Thibaud Desodt
 
Cleaning Code - Tools and Techniques for Large Legacy Projects
Cleaning Code - Tools and Techniques for Large Legacy ProjectsCleaning Code - Tools and Techniques for Large Legacy Projects
Cleaning Code - Tools and Techniques for Large Legacy ProjectsMike Long
 
Domain Driven Design Ruby Ways - JURNAL 05/10/2017
Domain Driven Design Ruby Ways -  JURNAL 05/10/2017Domain Driven Design Ruby Ways -  JURNAL 05/10/2017
Domain Driven Design Ruby Ways - JURNAL 05/10/2017Jonathan Wylliem
 
10 Hinweise für Architekten
10 Hinweise für Architekten10 Hinweise für Architekten
10 Hinweise für Architektenadesso AG
 
Understanding Microservices
Understanding Microservices Understanding Microservices
Understanding Microservices M A Hossain Tonu
 
Component based development | what, why and how
Component based development | what, why and howComponent based development | what, why and how
Component based development | what, why and howRakesh Kumar Jha
 
CPP11 - Function Design
CPP11 - Function DesignCPP11 - Function Design
CPP11 - Function DesignMichael Heron
 
Ten Advices for Architects
Ten Advices for ArchitectsTen Advices for Architects
Ten Advices for ArchitectsEberhard Wolff
 
Programming language paradigms
Programming language paradigmsProgramming language paradigms
Programming language paradigmsAshok Raj
 

Similar to Refactoring.pdf (20)

Code qualityCode qualityCode quality.pptx
Code qualityCode qualityCode quality.pptxCode qualityCode qualityCode quality.pptx
Code qualityCode qualityCode quality.pptx
 
Алексей Веркеенко "Symfony2 & REST API"
Алексей Веркеенко "Symfony2 & REST API" Алексей Веркеенко "Symfony2 & REST API"
Алексей Веркеенко "Symfony2 & REST API"
 
Client Technical Analysis of Legacy Software and Future Replacement
Client Technical Analysis of Legacy Software and Future ReplacementClient Technical Analysis of Legacy Software and Future Replacement
Client Technical Analysis of Legacy Software and Future Replacement
 
Software Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuableSoftware Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuable
 
Deep Dive into the Idea of Software Architecture
Deep Dive into the Idea of Software ArchitectureDeep Dive into the Idea of Software Architecture
Deep Dive into the Idea of Software Architecture
 
Metric driven refactoring
Metric driven refactoringMetric driven refactoring
Metric driven refactoring
 
Architecture Principles CodeStock
Architecture Principles CodeStock Architecture Principles CodeStock
Architecture Principles CodeStock
 
Coding Standard And Code Review
Coding Standard And Code ReviewCoding Standard And Code Review
Coding Standard And Code Review
 
Ekon20 mORMot Legacy Code Technical Debt Delphi Conference
Ekon20 mORMot Legacy Code Technical Debt Delphi Conference Ekon20 mORMot Legacy Code Technical Debt Delphi Conference
Ekon20 mORMot Legacy Code Technical Debt Delphi Conference
 
From ddd to DDD : My journey from data-driven development to Domain-Driven De...
From ddd to DDD : My journey from data-driven development to Domain-Driven De...From ddd to DDD : My journey from data-driven development to Domain-Driven De...
From ddd to DDD : My journey from data-driven development to Domain-Driven De...
 
Cleaning Code - Tools and Techniques for Large Legacy Projects
Cleaning Code - Tools and Techniques for Large Legacy ProjectsCleaning Code - Tools and Techniques for Large Legacy Projects
Cleaning Code - Tools and Techniques for Large Legacy Projects
 
Domain Driven Design Ruby Ways - JURNAL 05/10/2017
Domain Driven Design Ruby Ways -  JURNAL 05/10/2017Domain Driven Design Ruby Ways -  JURNAL 05/10/2017
Domain Driven Design Ruby Ways - JURNAL 05/10/2017
 
10 Hinweise für Architekten
10 Hinweise für Architekten10 Hinweise für Architekten
10 Hinweise für Architekten
 
Understanding Microservices
Understanding Microservices Understanding Microservices
Understanding Microservices
 
Component based development | what, why and how
Component based development | what, why and howComponent based development | what, why and how
Component based development | what, why and how
 
CPP11 - Function Design
CPP11 - Function DesignCPP11 - Function Design
CPP11 - Function Design
 
Ten Advices for Architects
Ten Advices for ArchitectsTen Advices for Architects
Ten Advices for Architects
 
S.O.L.I.D xp
S.O.L.I.D xpS.O.L.I.D xp
S.O.L.I.D xp
 
Writing S.O.L.I.D Code
Writing S.O.L.I.D CodeWriting S.O.L.I.D Code
Writing S.O.L.I.D Code
 
Programming language paradigms
Programming language paradigmsProgramming language paradigms
Programming language paradigms
 

Recently uploaded

Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 

Recently uploaded (20)

Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 

Refactoring.pdf

  • 1. REFACTORING Mnats Karakhanyan Senior iOS Developer at Buymie Smart Talk June June 30 2022
  • 2. WHAT IS REFACTORING Refactoring is the process of changing a software system in a way that does not alter the external behavior of the code yet improves its internal structure
  • 3. WHY SHOULD WE REFACTOR • Refactoring Improves the Design of Software • Refactoring Makes Software Easier to Understand • Refactoring Helps Find Bugs • Refactoring Helps Program Faster
  • 4. WHY SHOULD WE REFACTOR “I’m not a great programmer; I’m just a good programmer with great habits.” 
 Kent Beck
  • 5. WHY SHOULD WE REFACTOR • Quality • Clean code • Profesionalizm • Right Thing
  • 6. WHY SHOULD WE REFACTOR • Quality • Clean code • Profesionalizm • Right Thing Economy
  • 7. THE TWO HATS • Adding Functionality • Refactoring
  • 8. WORKFLOWS OF REFACTORING • TTD Refactoring • Litter-Pickup Refactoring • Comprehension Refactoring • Preparatory Refactoring • Planned Refactoring • Long Term Refactoring
  • 9. BAD SMELLS IN CODE Indications that there is trouble that can be solved by a refactoring
  • 10. BAD SMELLS IN CODE • Mysterious Name • Duplicated Code • Long Function • Long Parameter List • Global Data • Mutable Data • Divergent Change • Shotgun Surgery • Feature Envy • Middle Man • Insider Trading • Large Class • Alternative Classes with Different Interfaces • Data Class • Refused Bequest • Comments • Data Clumps • Primitive Obsession • Repeated Switches • Loops • Lazy Element • Speculative Generality • Temporary Field • Message Chains
  • 11. BAD SMELLS IN CODE • Mysterious Name • Duplicated Code • Long Function • Long Parameter List • Global Data • Mutable Data • Divergent Change • Shotgun Surgery • Feature Envy • Middle Man • Insider Trading • Large Class • Alternative Classes with Different Interfaces • Data Class • Refused Bequest • Comments • Data Clumps • Primitive Obsession • Repeated Switches • Loops • Lazy Element • Speculative Generality • Temporary Field • Message Chains
  • 12. BLOATERS Bloaters are code, methods and classes that have increased to such gargantuan proportions that they are hard to work with. Usually accumulate over time
  • 13. BLOATERS • Primitive Obsession • Data Clumps • Large Class • Long Parameter List • Long Function
  • 14. OBJECT-ORIENTATION ABUSERS Object Oriented concept not fully understood and utilized
  • 15. OBJECT-ORIENTATION ABUSERS • Temporary Field • Repeated Switches • Alternative Classes with 
 Different Interfaces • Refused Bequest
  • 16. CHANGE PREVENTERS Make changing the system unnecessarily difficult
  • 17. CHANGE PREVENTERS • Shotgun Surgery • Divergent Change
  • 18. DISPENSABLES Something pointless and unneeded whose absence would make the code cleaner, more efficient and easier to understand.
  • 19. DISPENSABLES • Lazy Element (Dead code) • Speculative Generality • Duplicated Code • Data Class
  • 20. COUPLERS Low coupling between objects/classes is one thedesirable goals of OO software
  • 21. COUPLERS • Feature Envy • Message Chains • Middle Man • Insider Trading
  • 22. EXAMPLE RECIPE • If you can obtain one parameter by asking another parameter for it, you can use Replace Parameter with Query • Rather than pulling lots of data out of an existing data structure, you can use Preserve Whole Object • If several parameters always fit together, combine them with Introduce Parameter Object • If a parameter is used as a flag to dispatch different behavior, use Remove Flag Argument • when multiple functions share several parameter values. Then, you can use Combine Functions into Class Long Parameter List
  • 23. BIBLIOGRAPHY Refactoring Improving the Design of Existing Code by Martin Fowler, with Kent Beck Clean Code: A Handbook of Agile Software Craftsmanship 
 by Robert C. Martin The Pragmatic Programmer: From Journeyman to Master by Andy Hunt Head First Design Patterns by Eric Freeman