SlideShare ist ein Scribd-Unternehmen logo
1 von 47
Downloaden Sie, um offline zu lesen
Definition (Martin Fowler)
“Refactoring is a disciplined
technique for restructuring an existing
body of code, altering its internal
structure without changing its
external behavior. “
“…a series of small behavior
preserving transformations. Each
transformation (called a "refactoring")
does little, but a sequence of these
transformations can produce a
significant restructuring. Since each
refactoring is small, it's less likely to
go wrong.“
Why
refactoring?
Core practice for good code
Pay technical debt – mess
Adapt design to the new requests
Pay technical debt – adapt later
Alternatives
Redesign
When we cannot change in small steps
Higher risks
Rewrite
More expensive (usually)
With clear requirements and a much simpler
solution, could be an option
Tactical refactoring
Refactoring
Refactoring - Improving the Design
of Existing Code by Martin Fowler
(with Kent Beck), 2 editions
Clean Code
RobertC. Martin books
Implementation patterns
Kent Beck book
Big Mess – external signs
Symptoms of Rotting Design
(Robert C. Martin )
Rigidity – difficult to change
Fragility – breaks in many places for any change
Immobility – cannot be reused
Viscosity – easier to do the wrong things (hacks)
Waste examples
Time to change, time to fix
Time to read & understand
Time to find features
Many defects
Big Mess – internally
Big size: components,
classes, functions
Big numbers: functions
and data members per
class
“Duplications” ~
Multiplications
Reverse of each
refactoring/clean code
pattern
Big Mess & Tactics
Hundreds of problems,
hundreds of tactics
Context matter
Some problems could have a bigger priority
• Important business-related rules are multiplicated
• Some modules are more important than others
• Some problems generate a bigger fragility
?
?
?
?
?
?
?
?
?
?
When faced with a hard change, first make it easy
first make it easy
See : https://www.facebook.com/notes/kent-beck/mastering-programming/1184427814923414/
After refactoring
• Change/Test/Debug/Refactor are easier
• Each functional flow has its own data transformation flow
• If …these flows are not sharing an unnecessary global context
https://blog.cleancoder.com/uncle-bob/2016/01/04/ALittleArchitecture.html
See similar discussions on tests : http://xunitpatterns.com/Erratic%20Test.html
See - The Clean CodeTalks - "Global State and Singletons" , by Misko Hevery
Where are hardcoded replicas?
What we duplicate
Technical mechanisms
More then “car newer engine vs. old engine”
Could be accepted if offer the same functionality
Increase complexity on change & maintenance
Business/Functionality
A threat to business integrity
IncreasedComplexity & Fragility
You will never stop fixing that
fragile
Fixed after refactoring
Lines of code – dramatically reduced
Work by coincidence
Local conventions
Hidden conventions
Important !
• Refactor & Help developers to avoid these bad habits
Bad habits
perpetual
Changes very quickly and accelerates !
more than evolutionary
Adaptive
Lean
Business DNA
Delivery
Feedback
Model
Inject
Business
Protect
most of the technologies are here !
https://www.martinfowler.com/articles/refactoring-external-service.html
Example:
2 cells Clean Architecture
What change together, should stay together
It should stay together that changes together
Stop Producing High Debt !
Waste
15 programmers produce debt,
2 are paying it
Avoid Waste
Help programmers to produce less debt
A mess is always a loss.”
modifying the program to look as if we had
known what we were doing all along
Ward Cunningham
https://youtu.be/pqeJFYwnkjE?t=1
Agile Design
Refactor
Design inadvertence debt !
You need more samples to extract a good abstraction.
Refactoring & Avoiding Waste
Lean Software development
Inspired from
Toyota Production System
Reference:
Lean Software Development:
An AgileToolkit - Mary and
Tom Poppendieck
Solutions: XP-like practices,
refactoring included
Motion
Defects
Overproduction
clear location for each responsibility
Sherlock’s “mind palace
Fragility
Lack of separation of concerns, feature envy
Extra complexity, effort
https://disciplinedagiledelivery.com/essence01/
http://www.agiledata.org/essays/databaseRefactoring.html
http://www.agiledata.org/essays/databaseRefactoringCatalog.html
http://agiledata.org/
Refactor technical debt away
identify debt
https://disciplinedagiledelivery.com/technical-debt/
Refactoring is a fundamental product survival practice
Info
Questions ?
Strategic refactoring. Refactoring strategies

Weitere ähnliche Inhalte

Was ist angesagt?

Design patterns ppt
Design patterns pptDesign patterns ppt
Design patterns ppt
Aman Jain
 
Service Oriented Architecture
Service Oriented ArchitectureService Oriented Architecture
Service Oriented Architecture
Sandeep Ganji
 
UML Diagram @ Software engineering discussion
UML Diagram @ Software engineering discussionUML Diagram @ Software engineering discussion
UML Diagram @ Software engineering discussion
CherryBerry2
 
Powershell Training
Powershell TrainingPowershell Training
Powershell Training
Fahad Noaman
 

Was ist angesagt? (20)

Mistakes - I’ve made a few. Blunders in event-driven architecture | Simon Aub...
Mistakes - I’ve made a few. Blunders in event-driven architecture | Simon Aub...Mistakes - I’ve made a few. Blunders in event-driven architecture | Simon Aub...
Mistakes - I’ve made a few. Blunders in event-driven architecture | Simon Aub...
 
Scaling Knowledge Graph Architectures with AI
Scaling Knowledge Graph Architectures with AIScaling Knowledge Graph Architectures with AI
Scaling Knowledge Graph Architectures with AI
 
Case tools
Case toolsCase tools
Case tools
 
DDD架構設計
DDD架構設計DDD架構設計
DDD架構設計
 
대화면 기기와 폴더블을 위한 앱 개발 (인공지능위크 2023)
대화면 기기와 폴더블을 위한 앱 개발 (인공지능위크 2023)대화면 기기와 폴더블을 위한 앱 개발 (인공지능위크 2023)
대화면 기기와 폴더블을 위한 앱 개발 (인공지능위크 2023)
 
Design patterns ppt
Design patterns pptDesign patterns ppt
Design patterns ppt
 
Software Architecture and Design - An Overview
Software Architecture and Design - An OverviewSoftware Architecture and Design - An Overview
Software Architecture and Design - An Overview
 
서비스 운영을 위한 디자인시스템 프로젝트
서비스 운영을 위한 디자인시스템 프로젝트서비스 운영을 위한 디자인시스템 프로젝트
서비스 운영을 위한 디자인시스템 프로젝트
 
Domain Driven Design – DDD além da teoria!, por Paulo Victor Gomes
Domain Driven Design – DDD além da teoria!, por Paulo Victor GomesDomain Driven Design – DDD além da teoria!, por Paulo Victor Gomes
Domain Driven Design – DDD além da teoria!, por Paulo Victor Gomes
 
Service Oriented Architecture
Service Oriented ArchitectureService Oriented Architecture
Service Oriented Architecture
 
쏘카프레임 구축 배경과 과정
 쏘카프레임 구축 배경과 과정 쏘카프레임 구축 배경과 과정
쏘카프레임 구축 배경과 과정
 
신입 개발자 생활백서 [개정판]
신입 개발자 생활백서 [개정판]신입 개발자 생활백서 [개정판]
신입 개발자 생활백서 [개정판]
 
Introduction to SOFTWARE ARCHITECTURE
Introduction to SOFTWARE ARCHITECTUREIntroduction to SOFTWARE ARCHITECTURE
Introduction to SOFTWARE ARCHITECTURE
 
Uml
UmlUml
Uml
 
Code Refactoring
Code RefactoringCode Refactoring
Code Refactoring
 
UML Diagram @ Software engineering discussion
UML Diagram @ Software engineering discussionUML Diagram @ Software engineering discussion
UML Diagram @ Software engineering discussion
 
Use case diagrams
Use case diagramsUse case diagrams
Use case diagrams
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Powershell Training
Powershell TrainingPowershell Training
Powershell Training
 
Refactoring: Improving the design of existing code
Refactoring: Improving the design of existing codeRefactoring: Improving the design of existing code
Refactoring: Improving the design of existing code
 

Ähnlich wie Strategic refactoring. Refactoring strategies

Contemporary Software Engineering Practices Together With Enterprise
Contemporary Software Engineering Practices Together With EnterpriseContemporary Software Engineering Practices Together With Enterprise
Contemporary Software Engineering Practices Together With Enterprise
Kenan Sevindik
 

Ähnlich wie Strategic refactoring. Refactoring strategies (20)

Refactoring, Emergent Design & Evolutionary Architecture
Refactoring, Emergent Design & Evolutionary ArchitectureRefactoring, Emergent Design & Evolutionary Architecture
Refactoring, Emergent Design & Evolutionary Architecture
 
Refactoring for Software Architecture Smells
Refactoring for Software Architecture SmellsRefactoring for Software Architecture Smells
Refactoring for Software Architecture Smells
 
mehdi-refactoring.pptx
mehdi-refactoring.pptxmehdi-refactoring.pptx
mehdi-refactoring.pptx
 
Winning People to DevOps
Winning People to DevOpsWinning People to DevOps
Winning People to DevOps
 
Refactoring, 2nd Edition
Refactoring, 2nd EditionRefactoring, 2nd Edition
Refactoring, 2nd Edition
 
J2EE Performance And Scalability Bp
J2EE Performance And Scalability BpJ2EE Performance And Scalability Bp
J2EE Performance And Scalability Bp
 
Refactoring 2 The Max
Refactoring 2 The MaxRefactoring 2 The Max
Refactoring 2 The Max
 
Refactoring to a system of systems
Refactoring to a system of systemsRefactoring to a system of systems
Refactoring to a system of systems
 
Acing architecture
Acing architectureAcing architecture
Acing architecture
 
A Software Factory Integrating Rational & WebSphere Tools
A Software Factory Integrating Rational & WebSphere ToolsA Software Factory Integrating Rational & WebSphere Tools
A Software Factory Integrating Rational & WebSphere Tools
 
Architecting for Change: An Agile Approach
Architecting for Change: An Agile ApproachArchitecting for Change: An Agile Approach
Architecting for Change: An Agile Approach
 
Refactoring: Gold from a Monolithic Legacy
Refactoring: Gold from a Monolithic LegacyRefactoring: Gold from a Monolithic Legacy
Refactoring: Gold from a Monolithic Legacy
 
Agile Architecture (MAE slides)
Agile Architecture (MAE slides)Agile Architecture (MAE slides)
Agile Architecture (MAE slides)
 
Contemporary Software Engineering Practices Together With Enterprise
Contemporary Software Engineering Practices Together With EnterpriseContemporary Software Engineering Practices Together With Enterprise
Contemporary Software Engineering Practices Together With Enterprise
 
CAST Architecture Checker
CAST Architecture CheckerCAST Architecture Checker
CAST Architecture Checker
 
Xp conf-tbd
Xp conf-tbdXp conf-tbd
Xp conf-tbd
 
Modern Evolutionary Software Architectures
Modern Evolutionary Software ArchitecturesModern Evolutionary Software Architectures
Modern Evolutionary Software Architectures
 
Gluster the ugly parts with Jeff Darcy
Gluster  the ugly parts with Jeff DarcyGluster  the ugly parts with Jeff Darcy
Gluster the ugly parts with Jeff Darcy
 
SCM Transformation Challenges and How to Overcome Them
SCM Transformation Challenges and How to Overcome ThemSCM Transformation Challenges and How to Overcome Them
SCM Transformation Challenges and How to Overcome Them
 
L02 What is Software Architecture?
L02 What is Software Architecture?L02 What is Software Architecture?
L02 What is Software Architecture?
 

Kürzlich hochgeladen

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 

Kürzlich hochgeladen (20)

BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptxBT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4j
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 

Strategic refactoring. Refactoring strategies