SlideShare une entreprise Scribd logo
1  sur  44
Code Refactoring
Lalit Kale
LalitKale@gmail.com
Preface
• Audience:
• Beginner and intermediate level of developers, technical leads and software architects
• interested in software design and development
• having trouble in understanding and Implementing software design Principles and Patterns
• People who are keen on improving their craft
• Presentation:
• Approx. Time: 1 Hour
• Discussion Over Monotonous Delivery
• Planned slides for Questions are marked with Question Icon, Feel free to jump in to express your thoughts
• Code Snippets to understand the concepts – Not Ready for Production
• All Views/Opinions expressed here are mine and nothing to do with my current/past employers
2
About Me
• Working on .NET from last 11 years
• Journey: Software Developer  Sr. Developer  Tech Lead  Architect
• Startup To Large Enterprise
• Hands on experience (Code daily for living)
• Interested in software architecture of High-Volume High Traffic distributed Systems
• Beginner in Python and Machine Learning
3
4
Source of Inspiration
Martin Fowler
Overview
• What is Refactoring?
• Why Refactoring?
• Refactoring Myths
• What To Refactor?
• Workflows Of Refactoring
• Refactoring Principles
• Refactoring Tools
• Refactoring Techniques
• Refactoring Thumbnails
• Summary
5
What is Refactoring?
6
What is Refactoring?
• Wikipedia
Refactoring is a redrafting process in which talk page content is moved, removed, revised,
restructured, hidden, or otherwise changed. It applies only in contexts where editors make
signed statements (such as talk and user namespaces),and has a number of uses, including:
7
• Improving the clarity and readability of a page
• Removal of off-topic, uncivil, unclear, or otherwise distracting material
• Restructuring of discussions for clarity
• Relocation of material to different sections or pages where it is more appropriate
What is Refactoring?
• Ward Cunningham
“Amelioration Pattern: The act of relieving ills and changing for the
better”
• ills = Software Rot factors
• Rigidity
• Fragility
• Needless complexity
• Toxicity
8
What is Code Refactoring?
• Martin Fowler
• "Refactoring is the process of changing a software system in such a way that it does not alter the
external behavior of the code yet improves its internal structure."
- Refactoring, The design of existing Code, Martin Fowler, 1999
• “Refactoring is a disciplined technique for restructuring an existing body of code, altering its
internal structure without changing its external behavior.
– Refactoring.com, Martin Fowler 2016
9
What is Code Refactoring?
“Refactoring is a disciplined technique for restructuring an existing body of
code, altering its internal structure without changing its external behavior.”
10
What is Code Refactoring?
Its heart is a series of small behavior preserving transformations. Each
transformation (called a “refactoring”) does little, but a sequence of
transformations can produce a significant restructuring. Since each
refactoring is small, it’s less likely to go wrong. The system is kept fully
working after each small refactoring, reducing the chances that a system can
get seriously broken during the restructuring.
11
Why Refactor?
12
13
Why Refactor?
“Programs must be written for people to read, and only incidentally for machines to
execute”—Abelson and Sussman
Why Refactor?
14
Green
Refactor
Red
Refactoring Makes code adaptable to change
Write a Failing Test Do All sins to Pass the Failing Test
– Kent Beck
Pay for all sins and clean up code
Why Refactor?
• Keep code focused
• Improving the clarity and readability of code
• Removal of unclear, or otherwise distracting boilerplates and code segments
• Restructuring for clarity
• Helps to pay timely technical debt
• Leads to lightweight pragmatic design
• Avoids code rot
15
Zen says “To move faster, you need to do it right”
Refactoring Myths
17
Refactoring Myths
• “If It isn’t Broken, Don't Fix It”
• So We do not need refactoring
• Then,
• You add more features
• You enhance existing features
• Better infrastructure emerge
• Your competition change
• Which Results in changing your application/system
• Fact: Change is one of the strongest force in software development
18
Refactoring Myths and Misunderstandings
• Symptoms
• “Refactoring Takes Time”
• “We need to plan for separate refactoring time “
• “This entire project needs refactoring”
• “Refactoring this project will need at least X Weeks/months”
• Underlying Myth: Refactoring is one time activity/Task
• Fact: Refactoring is continual Activity
19
Refactoring Myths and Misunderstandings
• Refactoring is Re-work
• Fact: Refactoring gives opportunity to fix inefficiencies in system
• For Refactoring, we need special tools
• Fact: Tools are important but not mandatory. Refactoring Mindset is mandatory
• Refactoring can replace Code Reviews
• Fact: Objective of Code reviews are quite different than those of refactoring.
So, you can not compare apples with oranges.
20
21
Refactoring Myths
Refactoring ≠ Re-Engineering
What To Refactor?
• In general
• Code written to satisfy the feature
• Unit Tests
• But Can be
• Database Queries and Schema
• Assembly/Package Arrangements
• Configurations
• API Endpoints
• Integration Tests
22
Workflows of Refactoring
23
24
Workflows of Refactoring
Refactoring Principles
• DRY – Do not Repeat Yourself
“Every piece of knowledge must have a single, unambiguous, authoritative
representation within a system” – Pragmatic Programmers
• If nothing else, duplication is the single most enemy you can pick up in
refactoring stage
25
Refactoring Principles
• KISS: Keep It Simple Stupid!
• Avoid Clever code. Write Clear Code.
26
Refactoring Principles
• YAGNI – You Ain’t Gonna Need It!
• Boy-Scout Rule
• SOLID Principles
• Greatly Helpful Practice: Pair Programming
27
Refactoring Tools
• For .NET
• Visual Studio IDE
• Resharper by JetBrains
• CodeRush by DevExpress
• JustCode by Telerik
28
• For Java
• Eclipse IDE
• IntelliJ
• JRefactory
Refactoring Techniques
29
Refactoring Techniques
• Abstraction Focused
• Encapsulate Field – force code to access the field with getter and setter methods
• Generalize Type – create more general types to allow for more code sharing
• Replace type-checking code with State/Strategy
• Replace conditional with polymorphism
30
Refactoring Techniques
• Isolation Focused
• Extract Class – moves part of the code from an existing class into a new class.
• Extract Method – to turn part of a larger method into a new method. By breaking down code
in smaller pieces, it is more easily understandable. This is also applicable to functions.
31
Refactoring Techniques
• Code Clarity Focused
• Move Method or Move Field – move to a more appropriate Class or source file
• Rename Method or Rename Field – changing the name into a new one that better reveals its
purpose
• Pull Up – move to a superclass
• Push Down – move to a subclass
32
Refactoring Techniques
• Refactoring Catalog
• http://refactoring.com/catalog/
• Problem Solution Summary of well-
known refactorings
• Maintained by Martin Fowler
33
34
Refactoring Thumbnails
Refactoring catalog is overwhelming…How I can remember everything?
You don’t need to…
Use Refactoring Thumbnails by Sven Gorts
Refactoring Thumbnails
• Clear, Pragmatic design will only emerge, If team members share a common understanding
• Common Understanding requires clear and unambiguous communication
• Should be quick and simple enough to iterate
• Without making actual code changes
Refactoring Thumbnails is the visual technique which satisfies all these
requirements
35
Refactoring Thumbnails
• Express the evolution of a design over period of time
• Sequence of high-level refactoring
• Present intermediate stages
36
Time
Refactoring Thumbnails - Example
• Start with : copy-paste code
• Evolve to : inheritance-based reuse
• Passing an : intermediate stage
• End with : interface-based solution
37
Time
38
Refactoring Thumbnails - Example
Move Feature Refactoring
39
Evolution Chart
Eliminate Duplication By Composition
Summary
• Refactoring is continuous activity and part of development workflow
• Re-Engineering != Refactoring
• Refactoring needs (unit+ Integration) tests to verify external behaviors.
• Refactoring Tools are extremely helpful but not mandatory
• Refactoring Techniques are better visualized with Refactoring Thumbnails and
Evolution Charts
40
Summary
Refactoring ➔ Clean Code ➔ Faster Delivery ➔ Happy Customers 
41
Resources
• https://en.wikipedia.org/wiki/Wikipedia:Refactoring_talk_pages
• http://www.refactoring.com
• www.Refactoring.be
• Book: Refactoring: Improving the Design of Existing Code
42
Thank You!
43
.
This presentation is shared under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International license. More information for this license is available at http://creativecommons.org/licenses/by-nc-sa/4.0/
All trademarks are the property of their respective owners. Lalit Kale makes no warranties, express, implied or statutory, as to the information in this presentation.
Lalit Kale
lalitkale@gmail.com
http://lalitkale.wordpress.com

Contenu connexe

Tendances

Bad Code Smells
Bad Code SmellsBad Code Smells
Bad Code Smellskim.mens
 
Refactoring 101
Refactoring 101Refactoring 101
Refactoring 101Adam Culp
 
Refactoring and code smells
Refactoring and code smellsRefactoring and code smells
Refactoring and code smellsPaul Nguyen
 
Software Re-engineering Forward & Reverse Engineering
Software Re-engineering Forward & Reverse EngineeringSoftware Re-engineering Forward & Reverse Engineering
Software Re-engineering Forward & Reverse EngineeringAli Raza
 
The Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable DesignThe Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable DesignVictor Rentea
 
Clean architecture - Protecting the Domain
Clean architecture - Protecting the DomainClean architecture - Protecting the Domain
Clean architecture - Protecting the DomainVictor Rentea
 
Software Reengineering
Software ReengineeringSoftware Reengineering
Software ReengineeringAbdul Wahid
 
Code Smells and Its type (With Example)
Code Smells and Its type (With Example)Code Smells and Its type (With Example)
Code Smells and Its type (With Example)Anshul Vinayak
 
Architecture design in software engineering
Architecture design in software engineeringArchitecture design in software engineering
Architecture design in software engineeringPreeti Mishra
 
Design Model & User Interface Design in Software Engineering
Design Model & User Interface Design in Software EngineeringDesign Model & User Interface Design in Software Engineering
Design Model & User Interface Design in Software EngineeringMeghaj Mallick
 
Python Advanced – Building on the foundation
Python Advanced – Building on the foundationPython Advanced – Building on the foundation
Python Advanced – Building on the foundationKevlin Henney
 

Tendances (20)

Tech talks#6: Code Refactoring
Tech talks#6: Code RefactoringTech talks#6: Code Refactoring
Tech talks#6: Code Refactoring
 
Code Refactoring
Code RefactoringCode Refactoring
Code Refactoring
 
Bad Code Smells
Bad Code SmellsBad Code Smells
Bad Code Smells
 
Code smell overview
Code smell overviewCode smell overview
Code smell overview
 
Refactoring 101
Refactoring 101Refactoring 101
Refactoring 101
 
Refactoring
RefactoringRefactoring
Refactoring
 
Legacy system.
Legacy system.Legacy system.
Legacy system.
 
Software design
Software designSoftware design
Software design
 
Refactoring and code smells
Refactoring and code smellsRefactoring and code smells
Refactoring and code smells
 
Clean Code
Clean CodeClean Code
Clean Code
 
Software Re-engineering Forward & Reverse Engineering
Software Re-engineering Forward & Reverse EngineeringSoftware Re-engineering Forward & Reverse Engineering
Software Re-engineering Forward & Reverse Engineering
 
The Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable DesignThe Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable Design
 
Code Smells
Code SmellsCode Smells
Code Smells
 
Clean architecture - Protecting the Domain
Clean architecture - Protecting the DomainClean architecture - Protecting the Domain
Clean architecture - Protecting the Domain
 
Software Reengineering
Software ReengineeringSoftware Reengineering
Software Reengineering
 
Software reengineering
Software reengineeringSoftware reengineering
Software reengineering
 
Code Smells and Its type (With Example)
Code Smells and Its type (With Example)Code Smells and Its type (With Example)
Code Smells and Its type (With Example)
 
Architecture design in software engineering
Architecture design in software engineeringArchitecture design in software engineering
Architecture design in software engineering
 
Design Model & User Interface Design in Software Engineering
Design Model & User Interface Design in Software EngineeringDesign Model & User Interface Design in Software Engineering
Design Model & User Interface Design in Software Engineering
 
Python Advanced – Building on the foundation
Python Advanced – Building on the foundationPython Advanced – Building on the foundation
Python Advanced – Building on the foundation
 

En vedette

Code Refactoring
Code RefactoringCode Refactoring
Code RefactoringYu-Chih Lin
 
Multicore Explosion and its impact in application software development (Year ...
Multicore Explosion and its impact in application software development (Year ...Multicore Explosion and its impact in application software development (Year ...
Multicore Explosion and its impact in application software development (Year ...Vasu Thiyagarajan
 
Refactoring code smell
Refactoring code smellRefactoring code smell
Refactoring code smellmartintsch
 
Refaktoryzacja kodu w języku PHP
Refaktoryzacja kodu w języku PHPRefaktoryzacja kodu w języku PHP
Refaktoryzacja kodu w języku PHPDevCastZone
 
FLTK Summer Course - Part III - Third Impact
FLTK Summer Course - Part III - Third ImpactFLTK Summer Course - Part III - Third Impact
FLTK Summer Course - Part III - Third ImpactMichel Alves
 
TMS - Schedule of Presentations and Reports
TMS - Schedule of Presentations and ReportsTMS - Schedule of Presentations and Reports
TMS - Schedule of Presentations and ReportsMichel Alves
 
Using Git on the Command Line
Using Git on the Command LineUsing Git on the Command Line
Using Git on the Command LineBrian Richards
 
FLTK Summer Course - Part I - First Impact - Exercises
FLTK Summer Course - Part I - First Impact - ExercisesFLTK Summer Course - Part I - First Impact - Exercises
FLTK Summer Course - Part I - First Impact - ExercisesMichel Alves
 
Servicios web con Python
Servicios web con PythonServicios web con Python
Servicios web con PythonManuel Pérez
 
Blisstering drupal module development ppt v1.2
Blisstering drupal module development ppt v1.2Blisstering drupal module development ppt v1.2
Blisstering drupal module development ppt v1.2Anil Sagar
 
FLTK Summer Course - Part VI - Sixth Impact - Exercises
FLTK Summer Course - Part VI - Sixth Impact - ExercisesFLTK Summer Course - Part VI - Sixth Impact - Exercises
FLTK Summer Course - Part VI - Sixth Impact - ExercisesMichel Alves
 
Manipulating file in Python
Manipulating file in PythonManipulating file in Python
Manipulating file in Pythonshoukatali500
 
"Git Hooked!" Using Git hooks to improve your software development process
"Git Hooked!" Using Git hooks to improve your software development process"Git Hooked!" Using Git hooks to improve your software development process
"Git Hooked!" Using Git hooks to improve your software development processPolished Geek LLC
 
Introduction to Git Commands and Concepts
Introduction to Git Commands and ConceptsIntroduction to Git Commands and Concepts
Introduction to Git Commands and ConceptsCarl Brown
 
Git hooks For PHP Developers
Git hooks For PHP DevelopersGit hooks For PHP Developers
Git hooks For PHP DevelopersUmut IŞIK
 
FLTK Summer Course - Part II - Second Impact
FLTK Summer Course - Part II - Second ImpactFLTK Summer Course - Part II - Second Impact
FLTK Summer Course - Part II - Second ImpactMichel Alves
 
FLTK Summer Course - Part VIII - Eighth Impact
FLTK Summer Course - Part VIII - Eighth ImpactFLTK Summer Course - Part VIII - Eighth Impact
FLTK Summer Course - Part VIII - Eighth ImpactMichel Alves
 
Code Refactoring - Live Coding Demo (JavaDay 2014)
Code Refactoring - Live Coding Demo (JavaDay 2014)Code Refactoring - Live Coding Demo (JavaDay 2014)
Code Refactoring - Live Coding Demo (JavaDay 2014)Peter Kofler
 
FLTK Summer Course - Part II - Second Impact - Exercises
FLTK Summer Course - Part II - Second Impact - Exercises FLTK Summer Course - Part II - Second Impact - Exercises
FLTK Summer Course - Part II - Second Impact - Exercises Michel Alves
 

En vedette (20)

Code Refactoring
Code RefactoringCode Refactoring
Code Refactoring
 
Multicore Explosion and its impact in application software development (Year ...
Multicore Explosion and its impact in application software development (Year ...Multicore Explosion and its impact in application software development (Year ...
Multicore Explosion and its impact in application software development (Year ...
 
Refactoring code smell
Refactoring code smellRefactoring code smell
Refactoring code smell
 
Refaktoryzacja kodu w języku PHP
Refaktoryzacja kodu w języku PHPRefaktoryzacja kodu w języku PHP
Refaktoryzacja kodu w języku PHP
 
FLTK Summer Course - Part III - Third Impact
FLTK Summer Course - Part III - Third ImpactFLTK Summer Course - Part III - Third Impact
FLTK Summer Course - Part III - Third Impact
 
TMS - Schedule of Presentations and Reports
TMS - Schedule of Presentations and ReportsTMS - Schedule of Presentations and Reports
TMS - Schedule of Presentations and Reports
 
Using Git on the Command Line
Using Git on the Command LineUsing Git on the Command Line
Using Git on the Command Line
 
FLTK Summer Course - Part I - First Impact - Exercises
FLTK Summer Course - Part I - First Impact - ExercisesFLTK Summer Course - Part I - First Impact - Exercises
FLTK Summer Course - Part I - First Impact - Exercises
 
Servicios web con Python
Servicios web con PythonServicios web con Python
Servicios web con Python
 
Blisstering drupal module development ppt v1.2
Blisstering drupal module development ppt v1.2Blisstering drupal module development ppt v1.2
Blisstering drupal module development ppt v1.2
 
FLTK Summer Course - Part VI - Sixth Impact - Exercises
FLTK Summer Course - Part VI - Sixth Impact - ExercisesFLTK Summer Course - Part VI - Sixth Impact - Exercises
FLTK Summer Course - Part VI - Sixth Impact - Exercises
 
Manipulating file in Python
Manipulating file in PythonManipulating file in Python
Manipulating file in Python
 
"Git Hooked!" Using Git hooks to improve your software development process
"Git Hooked!" Using Git hooks to improve your software development process"Git Hooked!" Using Git hooks to improve your software development process
"Git Hooked!" Using Git hooks to improve your software development process
 
Introduction to Git Commands and Concepts
Introduction to Git Commands and ConceptsIntroduction to Git Commands and Concepts
Introduction to Git Commands and Concepts
 
Git hooks For PHP Developers
Git hooks For PHP DevelopersGit hooks For PHP Developers
Git hooks For PHP Developers
 
FLTK Summer Course - Part II - Second Impact
FLTK Summer Course - Part II - Second ImpactFLTK Summer Course - Part II - Second Impact
FLTK Summer Course - Part II - Second Impact
 
Advanced Git
Advanced GitAdvanced Git
Advanced Git
 
FLTK Summer Course - Part VIII - Eighth Impact
FLTK Summer Course - Part VIII - Eighth ImpactFLTK Summer Course - Part VIII - Eighth Impact
FLTK Summer Course - Part VIII - Eighth Impact
 
Code Refactoring - Live Coding Demo (JavaDay 2014)
Code Refactoring - Live Coding Demo (JavaDay 2014)Code Refactoring - Live Coding Demo (JavaDay 2014)
Code Refactoring - Live Coding Demo (JavaDay 2014)
 
FLTK Summer Course - Part II - Second Impact - Exercises
FLTK Summer Course - Part II - Second Impact - Exercises FLTK Summer Course - Part II - Second Impact - Exercises
FLTK Summer Course - Part II - Second Impact - Exercises
 

Similaire à Code refactoring

The Power Of Refactoring (php|tek 09)
The Power Of Refactoring (php|tek 09)The Power Of Refactoring (php|tek 09)
The Power Of Refactoring (php|tek 09)Stefan Koopmanschap
 
Refactoring workshop
Refactoring workshop Refactoring workshop
Refactoring workshop Itzik Saban
 
The Power Of Refactoring (PHPCon Italia)
The Power Of Refactoring (PHPCon Italia)The Power Of Refactoring (PHPCon Italia)
The Power Of Refactoring (PHPCon Italia)Stefan Koopmanschap
 
Clean code presentation
Clean code presentationClean code presentation
Clean code presentationBhavin Gandhi
 
Project Life Cycle and Effort Estimation
Project Life Cycle andEffort EstimationProject Life Cycle andEffort Estimation
Project Life Cycle and Effort Estimationssuserb7c8b8
 
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
 
TDD and Related Techniques for Non Developers (2012)
TDD and Related Techniques for Non Developers (2012)TDD and Related Techniques for Non Developers (2012)
TDD and Related Techniques for Non Developers (2012)Peter Kofler
 
Refactor your code: when, why and how?
Refactor your code: when, why and how?Refactor your code: when, why and how?
Refactor your code: when, why and how?Nacho Cougil
 
Agile software development and extreme Programming
Agile software development and extreme Programming  Agile software development and extreme Programming
Agile software development and extreme Programming Fatemeh Karimi
 
Refactoring Legacy Code
Refactoring Legacy CodeRefactoring Legacy Code
Refactoring Legacy CodeAdam Culp
 
From silex to symfony and viceversa
From silex to symfony and viceversaFrom silex to symfony and viceversa
From silex to symfony and viceversaRonny López
 
Art of refactoring - Code Smells and Microservices Antipatterns
Art of refactoring - Code Smells and Microservices AntipatternsArt of refactoring - Code Smells and Microservices Antipatterns
Art of refactoring - Code Smells and Microservices AntipatternsEl Mahdi Benzekri
 
Modern software architect post the agile wave
Modern software architect post the agile waveModern software architect post the agile wave
Modern software architect post the agile waveNiels Bech Nielsen
 
Agile Session @ Universidade Portucalense
Agile Session @ Universidade PortucalenseAgile Session @ Universidade Portucalense
Agile Session @ Universidade PortucalenseRui M. Barreira
 
DOES16 London - Jonathan Fletcher - Re-imagining Hiscox IT: A DevOps Story
DOES16 London - Jonathan Fletcher - Re-imagining Hiscox IT: A DevOps StoryDOES16 London - Jonathan Fletcher - Re-imagining Hiscox IT: A DevOps Story
DOES16 London - Jonathan Fletcher - Re-imagining Hiscox IT: A DevOps StoryGene Kim
 
Coding Standard And Code Review
Coding Standard And Code ReviewCoding Standard And Code Review
Coding Standard And Code ReviewMilan Vukoje
 
Building environment of #UserDevOps and not only DevOps
Building environment of #UserDevOps and not only DevOpsBuilding environment of #UserDevOps and not only DevOps
Building environment of #UserDevOps and not only DevOpsRajnish Chauhan
 

Similaire à Code refactoring (20)

The Power Of Refactoring (php|tek 09)
The Power Of Refactoring (php|tek 09)The Power Of Refactoring (php|tek 09)
The Power Of Refactoring (php|tek 09)
 
Refactoring workshop
Refactoring workshop Refactoring workshop
Refactoring workshop
 
The Power Of Refactoring (PHPCon Italia)
The Power Of Refactoring (PHPCon Italia)The Power Of Refactoring (PHPCon Italia)
The Power Of Refactoring (PHPCon Italia)
 
Eurosport's Kodakademi #2
Eurosport's Kodakademi #2Eurosport's Kodakademi #2
Eurosport's Kodakademi #2
 
Clean code presentation
Clean code presentationClean code presentation
Clean code presentation
 
Project Life Cycle and Effort Estimation
Project Life Cycle andEffort EstimationProject Life Cycle andEffort Estimation
Project Life Cycle and Effort Estimation
 
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
 
TDD and Related Techniques for Non Developers (2012)
TDD and Related Techniques for Non Developers (2012)TDD and Related Techniques for Non Developers (2012)
TDD and Related Techniques for Non Developers (2012)
 
Refactor your code: when, why and how?
Refactor your code: when, why and how?Refactor your code: when, why and how?
Refactor your code: when, why and how?
 
Agile software development and extreme Programming
Agile software development and extreme Programming  Agile software development and extreme Programming
Agile software development and extreme Programming
 
Refactoring Legacy Code
Refactoring Legacy CodeRefactoring Legacy Code
Refactoring Legacy Code
 
From silex to symfony and viceversa
From silex to symfony and viceversaFrom silex to symfony and viceversa
From silex to symfony and viceversa
 
Art of refactoring - Code Smells and Microservices Antipatterns
Art of refactoring - Code Smells and Microservices AntipatternsArt of refactoring - Code Smells and Microservices Antipatterns
Art of refactoring - Code Smells and Microservices Antipatterns
 
Modern software architect post the agile wave
Modern software architect post the agile waveModern software architect post the agile wave
Modern software architect post the agile wave
 
Agile Session @ Universidade Portucalense
Agile Session @ Universidade PortucalenseAgile Session @ Universidade Portucalense
Agile Session @ Universidade Portucalense
 
mehdi-refactoring.pptx
mehdi-refactoring.pptxmehdi-refactoring.pptx
mehdi-refactoring.pptx
 
DOES16 London - Jonathan Fletcher - Re-imagining Hiscox IT: A DevOps Story
DOES16 London - Jonathan Fletcher - Re-imagining Hiscox IT: A DevOps StoryDOES16 London - Jonathan Fletcher - Re-imagining Hiscox IT: A DevOps Story
DOES16 London - Jonathan Fletcher - Re-imagining Hiscox IT: A DevOps Story
 
Coding Standard And Code Review
Coding Standard And Code ReviewCoding Standard And Code Review
Coding Standard And Code Review
 
Refactoring.pdf
Refactoring.pdfRefactoring.pdf
Refactoring.pdf
 
Building environment of #UserDevOps and not only DevOps
Building environment of #UserDevOps and not only DevOpsBuilding environment of #UserDevOps and not only DevOps
Building environment of #UserDevOps and not only DevOps
 

Plus de Lalit Kale

Serverless microservices
Serverless microservicesServerless microservices
Serverless microservicesLalit Kale
 
Develop in ludicrous mode with azure serverless
Develop in ludicrous mode with azure serverlessDevelop in ludicrous mode with azure serverless
Develop in ludicrous mode with azure serverlessLalit Kale
 
For Business's Sake, Let's focus on AppSec
For Business's Sake, Let's focus on AppSecFor Business's Sake, Let's focus on AppSec
For Business's Sake, Let's focus on AppSecLalit Kale
 
Introduction To Microservices
Introduction To MicroservicesIntroduction To Microservices
Introduction To MicroservicesLalit Kale
 
Dot net platform and dotnet core fundamentals
Dot net platform and dotnet core fundamentalsDot net platform and dotnet core fundamentals
Dot net platform and dotnet core fundamentalsLalit Kale
 
Application Security Tools
Application Security ToolsApplication Security Tools
Application Security ToolsLalit Kale
 
Threat Modeling And Analysis
Threat Modeling And AnalysisThreat Modeling And Analysis
Threat Modeling And AnalysisLalit Kale
 
Application Security-Understanding The Horizon
Application Security-Understanding The HorizonApplication Security-Understanding The Horizon
Application Security-Understanding The HorizonLalit Kale
 
Coding guidelines
Coding guidelinesCoding guidelines
Coding guidelinesLalit Kale
 
Code review guidelines
Code review guidelinesCode review guidelines
Code review guidelinesLalit Kale
 
State management
State managementState management
State managementLalit Kale
 
Implementing application security using the .net framework
Implementing application security using the .net frameworkImplementing application security using the .net framework
Implementing application security using the .net frameworkLalit Kale
 
Data normailazation
Data normailazationData normailazation
Data normailazationLalit Kale
 
Versioning guidelines for product
Versioning guidelines for productVersioning guidelines for product
Versioning guidelines for productLalit Kale
 
Bowling Game Kata by Robert C. Martin
Bowling Game Kata by Robert C. MartinBowling Game Kata by Robert C. Martin
Bowling Game Kata by Robert C. MartinLalit Kale
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven DesignLalit Kale
 
Web 2.0 concept
Web 2.0 conceptWeb 2.0 concept
Web 2.0 conceptLalit Kale
 
Jump Start To Ooad And Design Patterns
Jump Start To Ooad And Design PatternsJump Start To Ooad And Design Patterns
Jump Start To Ooad And Design PatternsLalit Kale
 
How To Create Strategic Marketing Plan
How To Create Strategic Marketing PlanHow To Create Strategic Marketing Plan
How To Create Strategic Marketing PlanLalit Kale
 

Plus de Lalit Kale (20)

Serverless microservices
Serverless microservicesServerless microservices
Serverless microservices
 
Develop in ludicrous mode with azure serverless
Develop in ludicrous mode with azure serverlessDevelop in ludicrous mode with azure serverless
Develop in ludicrous mode with azure serverless
 
For Business's Sake, Let's focus on AppSec
For Business's Sake, Let's focus on AppSecFor Business's Sake, Let's focus on AppSec
For Business's Sake, Let's focus on AppSec
 
Introduction To Microservices
Introduction To MicroservicesIntroduction To Microservices
Introduction To Microservices
 
Dot net platform and dotnet core fundamentals
Dot net platform and dotnet core fundamentalsDot net platform and dotnet core fundamentals
Dot net platform and dotnet core fundamentals
 
Application Security Tools
Application Security ToolsApplication Security Tools
Application Security Tools
 
Threat Modeling And Analysis
Threat Modeling And AnalysisThreat Modeling And Analysis
Threat Modeling And Analysis
 
Application Security-Understanding The Horizon
Application Security-Understanding The HorizonApplication Security-Understanding The Horizon
Application Security-Understanding The Horizon
 
Coding guidelines
Coding guidelinesCoding guidelines
Coding guidelines
 
Code review guidelines
Code review guidelinesCode review guidelines
Code review guidelines
 
State management
State managementState management
State management
 
Implementing application security using the .net framework
Implementing application security using the .net frameworkImplementing application security using the .net framework
Implementing application security using the .net framework
 
Data normailazation
Data normailazationData normailazation
Data normailazation
 
Opps
OppsOpps
Opps
 
Versioning guidelines for product
Versioning guidelines for productVersioning guidelines for product
Versioning guidelines for product
 
Bowling Game Kata by Robert C. Martin
Bowling Game Kata by Robert C. MartinBowling Game Kata by Robert C. Martin
Bowling Game Kata by Robert C. Martin
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Web 2.0 concept
Web 2.0 conceptWeb 2.0 concept
Web 2.0 concept
 
Jump Start To Ooad And Design Patterns
Jump Start To Ooad And Design PatternsJump Start To Ooad And Design Patterns
Jump Start To Ooad And Design Patterns
 
How To Create Strategic Marketing Plan
How To Create Strategic Marketing PlanHow To Create Strategic Marketing Plan
How To Create Strategic Marketing Plan
 

Dernier

Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 

Dernier (20)

Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 

Code refactoring

  • 2. Preface • Audience: • Beginner and intermediate level of developers, technical leads and software architects • interested in software design and development • having trouble in understanding and Implementing software design Principles and Patterns • People who are keen on improving their craft • Presentation: • Approx. Time: 1 Hour • Discussion Over Monotonous Delivery • Planned slides for Questions are marked with Question Icon, Feel free to jump in to express your thoughts • Code Snippets to understand the concepts – Not Ready for Production • All Views/Opinions expressed here are mine and nothing to do with my current/past employers 2
  • 3. About Me • Working on .NET from last 11 years • Journey: Software Developer  Sr. Developer  Tech Lead  Architect • Startup To Large Enterprise • Hands on experience (Code daily for living) • Interested in software architecture of High-Volume High Traffic distributed Systems • Beginner in Python and Machine Learning 3
  • 5. Overview • What is Refactoring? • Why Refactoring? • Refactoring Myths • What To Refactor? • Workflows Of Refactoring • Refactoring Principles • Refactoring Tools • Refactoring Techniques • Refactoring Thumbnails • Summary 5
  • 7. What is Refactoring? • Wikipedia Refactoring is a redrafting process in which talk page content is moved, removed, revised, restructured, hidden, or otherwise changed. It applies only in contexts where editors make signed statements (such as talk and user namespaces),and has a number of uses, including: 7 • Improving the clarity and readability of a page • Removal of off-topic, uncivil, unclear, or otherwise distracting material • Restructuring of discussions for clarity • Relocation of material to different sections or pages where it is more appropriate
  • 8. What is Refactoring? • Ward Cunningham “Amelioration Pattern: The act of relieving ills and changing for the better” • ills = Software Rot factors • Rigidity • Fragility • Needless complexity • Toxicity 8
  • 9. What is Code Refactoring? • Martin Fowler • "Refactoring is the process of changing a software system in such a way that it does not alter the external behavior of the code yet improves its internal structure." - Refactoring, The design of existing Code, Martin Fowler, 1999 • “Refactoring is a disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior. – Refactoring.com, Martin Fowler 2016 9
  • 10. What is Code Refactoring? “Refactoring is a disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior.” 10
  • 11. What is Code Refactoring? Its heart is a series of small behavior preserving transformations. Each transformation (called a “refactoring”) does little, but a sequence of transformations can produce a significant restructuring. Since each refactoring is small, it’s less likely to go wrong. The system is kept fully working after each small refactoring, reducing the chances that a system can get seriously broken during the restructuring. 11
  • 13. 13 Why Refactor? “Programs must be written for people to read, and only incidentally for machines to execute”—Abelson and Sussman
  • 14. Why Refactor? 14 Green Refactor Red Refactoring Makes code adaptable to change Write a Failing Test Do All sins to Pass the Failing Test – Kent Beck Pay for all sins and clean up code
  • 15. Why Refactor? • Keep code focused • Improving the clarity and readability of code • Removal of unclear, or otherwise distracting boilerplates and code segments • Restructuring for clarity • Helps to pay timely technical debt • Leads to lightweight pragmatic design • Avoids code rot 15
  • 16. Zen says “To move faster, you need to do it right”
  • 18. Refactoring Myths • “If It isn’t Broken, Don't Fix It” • So We do not need refactoring • Then, • You add more features • You enhance existing features • Better infrastructure emerge • Your competition change • Which Results in changing your application/system • Fact: Change is one of the strongest force in software development 18
  • 19. Refactoring Myths and Misunderstandings • Symptoms • “Refactoring Takes Time” • “We need to plan for separate refactoring time “ • “This entire project needs refactoring” • “Refactoring this project will need at least X Weeks/months” • Underlying Myth: Refactoring is one time activity/Task • Fact: Refactoring is continual Activity 19
  • 20. Refactoring Myths and Misunderstandings • Refactoring is Re-work • Fact: Refactoring gives opportunity to fix inefficiencies in system • For Refactoring, we need special tools • Fact: Tools are important but not mandatory. Refactoring Mindset is mandatory • Refactoring can replace Code Reviews • Fact: Objective of Code reviews are quite different than those of refactoring. So, you can not compare apples with oranges. 20
  • 22. What To Refactor? • In general • Code written to satisfy the feature • Unit Tests • But Can be • Database Queries and Schema • Assembly/Package Arrangements • Configurations • API Endpoints • Integration Tests 22
  • 25. Refactoring Principles • DRY – Do not Repeat Yourself “Every piece of knowledge must have a single, unambiguous, authoritative representation within a system” – Pragmatic Programmers • If nothing else, duplication is the single most enemy you can pick up in refactoring stage 25
  • 26. Refactoring Principles • KISS: Keep It Simple Stupid! • Avoid Clever code. Write Clear Code. 26
  • 27. Refactoring Principles • YAGNI – You Ain’t Gonna Need It! • Boy-Scout Rule • SOLID Principles • Greatly Helpful Practice: Pair Programming 27
  • 28. Refactoring Tools • For .NET • Visual Studio IDE • Resharper by JetBrains • CodeRush by DevExpress • JustCode by Telerik 28 • For Java • Eclipse IDE • IntelliJ • JRefactory
  • 30. Refactoring Techniques • Abstraction Focused • Encapsulate Field – force code to access the field with getter and setter methods • Generalize Type – create more general types to allow for more code sharing • Replace type-checking code with State/Strategy • Replace conditional with polymorphism 30
  • 31. Refactoring Techniques • Isolation Focused • Extract Class – moves part of the code from an existing class into a new class. • Extract Method – to turn part of a larger method into a new method. By breaking down code in smaller pieces, it is more easily understandable. This is also applicable to functions. 31
  • 32. Refactoring Techniques • Code Clarity Focused • Move Method or Move Field – move to a more appropriate Class or source file • Rename Method or Rename Field – changing the name into a new one that better reveals its purpose • Pull Up – move to a superclass • Push Down – move to a subclass 32
  • 33. Refactoring Techniques • Refactoring Catalog • http://refactoring.com/catalog/ • Problem Solution Summary of well- known refactorings • Maintained by Martin Fowler 33
  • 34. 34 Refactoring Thumbnails Refactoring catalog is overwhelming…How I can remember everything? You don’t need to… Use Refactoring Thumbnails by Sven Gorts
  • 35. Refactoring Thumbnails • Clear, Pragmatic design will only emerge, If team members share a common understanding • Common Understanding requires clear and unambiguous communication • Should be quick and simple enough to iterate • Without making actual code changes Refactoring Thumbnails is the visual technique which satisfies all these requirements 35
  • 36. Refactoring Thumbnails • Express the evolution of a design over period of time • Sequence of high-level refactoring • Present intermediate stages 36 Time
  • 37. Refactoring Thumbnails - Example • Start with : copy-paste code • Evolve to : inheritance-based reuse • Passing an : intermediate stage • End with : interface-based solution 37 Time
  • 38. 38 Refactoring Thumbnails - Example Move Feature Refactoring
  • 40. Summary • Refactoring is continuous activity and part of development workflow • Re-Engineering != Refactoring • Refactoring needs (unit+ Integration) tests to verify external behaviors. • Refactoring Tools are extremely helpful but not mandatory • Refactoring Techniques are better visualized with Refactoring Thumbnails and Evolution Charts 40
  • 41. Summary Refactoring ➔ Clean Code ➔ Faster Delivery ➔ Happy Customers  41
  • 42. Resources • https://en.wikipedia.org/wiki/Wikipedia:Refactoring_talk_pages • http://www.refactoring.com • www.Refactoring.be • Book: Refactoring: Improving the Design of Existing Code 42
  • 44. . This presentation is shared under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International license. More information for this license is available at http://creativecommons.org/licenses/by-nc-sa/4.0/ All trademarks are the property of their respective owners. Lalit Kale makes no warranties, express, implied or statutory, as to the information in this presentation. Lalit Kale lalitkale@gmail.com http://lalitkale.wordpress.com