SlideShare a Scribd company logo
1 of 64
Download to read offline
Refactoring your way
out of the mess
@WolframKriesing, uxebu - JavaScript company
Improve structure all the time
was not possible with this tower, of course
A bit of history
Design is hard.
The design of
reusable software
is especially hard.
Reusable software usually is the
result of many design iterations.
William F. Opdyke, 1992
it’sallaboutdesign
http://martinfowler.com/books/refactoring.html
base
controlled technique
code
improving design
applying
series small
tranformations too small to be worth doing
tranformations
cumulative
significant
error
small steps
reduce risk
avoid
system
broken
carrying out
restructuring
allows
gradually refactor
system
extended period of time
Reasons to refactor
(refactoring workflows)
http://martinfowler.com/articles/workflowsOfRefactoring/
# 1
#2 - Litter-Pickup
#3comprehensionrefactoring
prepare
#4
#5
#6 Long-Term
Refactoring
• Design
• Gradually get to a new design
• Little jumps
• Parallel refactoring
„If somebody talks about a system being
broken for a couple of days while they
are refactoring, you can be pretty sure
they are not refactoring.“
http://martinfowler.com/bliki/RefactoringMalapropism.html
1 TDD Refactoring
2 Litter-Pickup Refactoring
3 Comprehension Refactoring
4 Preparatory Refactoring
5 Planned Refactoring
6 Long-Term Refactoring
–Martin Fowler
„Refactoring (noun):
a change made to the
internal structure of
software to make it easier to
understand and cheaper to
modify without changing its
observable behavior.“
Why?
How?
What?
Write Code
Read Code
Easier to understand?
- less to read!
- expressive
The Power Of (Long) Names
Let’s use our time more efficiently!
How?
How?
„If you are doing refactoring
your system should
not be broken for more than
a few minutes at a time“
http://martinfowler.com/bliki/RefactoringMalapropism.html
broken?
requires tests
–Martin Fowler
„Refactoring (noun):
a change made to the
internal structure of
software to make it easier to
understand and cheaper to
modify without changing its
observable behavior.“
stay green
stay green
reflected in tests
Tests?
LEGACY
Tests?
http://www.merriam-webster.com/dictionary/observable
observable
behavior
implementation detail
test this
DONT test this
implementation detail
test right!
OR disable refactoring
Tests?
„If you are doing refactoring
your system should
not be broken for more than
a few minutes at a time“
http://martinfowler.com/bliki/RefactoringMalapropism.html
baby stepping on green
baby steps
stay green
have the right tests
don’t test
implementation detail
Why refactor?
think in economics
not in code ethics
http://martinfowler.com/bliki/DesignStaminaHypothesis.html
What to refactor
https://github.com/
emilybache/
Tennis-Refactoring-Kata
thx
@WolframKriesing, uxebu - JavaScript company

More Related Content

What's hot

Using Continuous Integration To Ensure Project Health New
Using Continuous Integration To Ensure Project Health NewUsing Continuous Integration To Ensure Project Health New
Using Continuous Integration To Ensure Project Health New
bartlowe
 
Continuous Integration and Delivery
Continuous Integration and DeliveryContinuous Integration and Delivery
Continuous Integration and Delivery
Brandon Cornett
 
Everything you ever wanted to know about deployment but were afraid to ask
Everything you ever wanted to know about deployment but were afraid to askEverything you ever wanted to know about deployment but were afraid to ask
Everything you ever wanted to know about deployment but were afraid to ask
lauraxthomson
 
Deployment taken seriously with Octopus Deploy and TeamCity
Deployment taken seriously with Octopus Deploy and TeamCityDeployment taken seriously with Octopus Deploy and TeamCity
Deployment taken seriously with Octopus Deploy and TeamCity
Tomas Jansson
 

What's hot (18)

Selenium and Continuous Intergration
Selenium and Continuous IntergrationSelenium and Continuous Intergration
Selenium and Continuous Intergration
 
Distributed Development
Distributed DevelopmentDistributed Development
Distributed Development
 
Source control - what you need to know
Source control - what you need to knowSource control - what you need to know
Source control - what you need to know
 
Advanced CCPM concepts for IT Program Management
Advanced CCPM concepts for IT Program ManagementAdvanced CCPM concepts for IT Program Management
Advanced CCPM concepts for IT Program Management
 
CI/CD and automated Test
CI/CD and automated TestCI/CD and automated Test
CI/CD and automated Test
 
Using Continuous Integration To Ensure Project Health New
Using Continuous Integration To Ensure Project Health NewUsing Continuous Integration To Ensure Project Health New
Using Continuous Integration To Ensure Project Health New
 
Bootstrapping Quality
Bootstrapping QualityBootstrapping Quality
Bootstrapping Quality
 
Continuous Integration and Delivery
Continuous Integration and DeliveryContinuous Integration and Delivery
Continuous Integration and Delivery
 
7 things you should know before going serverless
7 things you should know before going serverless7 things you should know before going serverless
7 things you should know before going serverless
 
Production Ready WordPress - WC Utrecht 2017
Production Ready WordPress  - WC Utrecht 2017Production Ready WordPress  - WC Utrecht 2017
Production Ready WordPress - WC Utrecht 2017
 
Master C++ compilers
Master C++ compilersMaster C++ compilers
Master C++ compilers
 
Continuous Integration and Builds
Continuous Integration and BuildsContinuous Integration and Builds
Continuous Integration and Builds
 
Putting the pro in programmer
Putting the pro in programmerPutting the pro in programmer
Putting the pro in programmer
 
Octopus Deploy Tech Fest 2014
Octopus Deploy Tech Fest 2014Octopus Deploy Tech Fest 2014
Octopus Deploy Tech Fest 2014
 
Agileee 2012
Agileee 2012Agileee 2012
Agileee 2012
 
Put "fast" back in "fast feedback"
Put "fast" back in "fast feedback"Put "fast" back in "fast feedback"
Put "fast" back in "fast feedback"
 
Everything you ever wanted to know about deployment but were afraid to ask
Everything you ever wanted to know about deployment but were afraid to askEverything you ever wanted to know about deployment but were afraid to ask
Everything you ever wanted to know about deployment but were afraid to ask
 
Deployment taken seriously with Octopus Deploy and TeamCity
Deployment taken seriously with Octopus Deploy and TeamCityDeployment taken seriously with Octopus Deploy and TeamCity
Deployment taken seriously with Octopus Deploy and TeamCity
 

Viewers also liked

02 JavaScript Syntax
02 JavaScript Syntax02 JavaScript Syntax
02 JavaScript Syntax
Ynon Perek
 

Viewers also liked (10)

Our react-native experiences at crewmeister
Our react-native experiences at crewmeisterOur react-native experiences at crewmeister
Our react-native experiences at crewmeister
 
ES6Katas.org - an introduction and the story behind
ES6Katas.org - an introduction and the story behindES6Katas.org - an introduction and the story behind
ES6Katas.org - an introduction and the story behind
 
завуч и директор
завуч и директорзавуч и директор
завуч и директор
 
Presentationfor lnl
Presentationfor lnlPresentationfor lnl
Presentationfor lnl
 
Frontend Engineer Toolbox
Frontend Engineer ToolboxFrontend Engineer Toolbox
Frontend Engineer Toolbox
 
САЙТ ГИМНАЗИИ
САЙТ ГИМНАЗИИ САЙТ ГИМНАЗИИ
САЙТ ГИМНАЗИИ
 
Kontseptsiya nova shkola
Kontseptsiya nova shkolaKontseptsiya nova shkola
Kontseptsiya nova shkola
 
Mobile HTML, CSS, and JavaScript
Mobile HTML, CSS, and JavaScriptMobile HTML, CSS, and JavaScript
Mobile HTML, CSS, and JavaScript
 
02 JavaScript Syntax
02 JavaScript Syntax02 JavaScript Syntax
02 JavaScript Syntax
 
Understanding & Designing for the Mobile Web
Understanding & Designing for the Mobile WebUnderstanding & Designing for the Mobile Web
Understanding & Designing for the Mobile Web
 

Similar to Refactoring out of the mess

Similar to Refactoring out of the mess (20)

Day2 - Refactoring (Lecture SS 2015)
Day2 - Refactoring (Lecture SS 2015)Day2 - Refactoring (Lecture SS 2015)
Day2 - Refactoring (Lecture SS 2015)
 
A Scalable Software Build Accelerator
A Scalable Software Build AcceleratorA Scalable Software Build Accelerator
A Scalable Software Build Accelerator
 
Agile
AgileAgile
Agile
 
DevOps explained
DevOps explainedDevOps explained
DevOps explained
 
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)
 
10 Reasons You MUST Consider Pattern-Aware Programming
10 Reasons You MUST Consider Pattern-Aware Programming10 Reasons You MUST Consider Pattern-Aware Programming
10 Reasons You MUST Consider Pattern-Aware Programming
 
10 Ways To Improve Your Code
10 Ways To Improve Your Code10 Ways To Improve Your Code
10 Ways To Improve Your Code
 
Refactoring 2 The Max
Refactoring 2 The MaxRefactoring 2 The Max
Refactoring 2 The Max
 
The Power Of Refactoring (PHPCon Italia)
The Power Of Refactoring (PHPCon Italia)The Power Of Refactoring (PHPCon Italia)
The Power Of Refactoring (PHPCon Italia)
 
Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?
 
Adventures in docker compose
Adventures in docker composeAdventures in docker compose
Adventures in docker compose
 
Cloud Native Dünyada CI/CD
Cloud Native Dünyada CI/CDCloud Native Dünyada CI/CD
Cloud Native Dünyada CI/CD
 
Journey toward3rdplatform
Journey toward3rdplatformJourney toward3rdplatform
Journey toward3rdplatform
 
Extensible dev secops pipelines with Jenkins, Docker, Terraform, and a kitche...
Extensible dev secops pipelines with Jenkins, Docker, Terraform, and a kitche...Extensible dev secops pipelines with Jenkins, Docker, Terraform, and a kitche...
Extensible dev secops pipelines with Jenkins, Docker, Terraform, and a kitche...
 
Refactoring, 2nd Edition
Refactoring, 2nd EditionRefactoring, 2nd Edition
Refactoring, 2nd Edition
 
DevOps and Build Automation
DevOps and Build AutomationDevOps and Build Automation
DevOps and Build Automation
 
Azug BE Session Nov 2018 Wim Van den Broeck
Azug BE Session Nov 2018 Wim Van den BroeckAzug BE Session Nov 2018 Wim Van den Broeck
Azug BE Session Nov 2018 Wim Van den Broeck
 
Devops - why, what and how?
Devops - why, what and how?Devops - why, what and how?
Devops - why, what and how?
 
Put to the Test
Put to the TestPut to the Test
Put to the Test
 
Using Multi-stage Docker, Go, Java,& Bazel to DESTROY Long Build Times
Using Multi-stage Docker, Go, Java,& Bazel to DESTROY Long Build TimesUsing Multi-stage Docker, Go, Java,& Bazel to DESTROY Long Build Times
Using Multi-stage Docker, Go, Java,& Bazel to DESTROY Long Build Times
 

More from wolframkriesing

react.js - DOM as it was meant
react.js - DOM as it was meantreact.js - DOM as it was meant
react.js - DOM as it was meant
wolframkriesing
 
Pixelplant - WebDev Meetup Salzburg
Pixelplant - WebDev Meetup SalzburgPixelplant - WebDev Meetup Salzburg
Pixelplant - WebDev Meetup Salzburg
wolframkriesing
 
Presentation Mobile Monday Munich, March 2012
Presentation Mobile Monday Munich, March 2012Presentation Mobile Monday Munich, March 2012
Presentation Mobile Monday Munich, March 2012
wolframkriesing
 
Webtestsuite black berrydevcon
Webtestsuite black berrydevconWebtestsuite black berrydevcon
Webtestsuite black berrydevcon
wolframkriesing
 
NEXT11, Puzzle pieces of our mobile web approach
NEXT11, Puzzle pieces of our mobile web approachNEXT11, Puzzle pieces of our mobile web approach
NEXT11, Puzzle pieces of our mobile web approach
wolframkriesing
 
Java scriptgettingstarted
Java scriptgettingstartedJava scriptgettingstarted
Java scriptgettingstarted
wolframkriesing
 

More from wolframkriesing (20)

JavaScript The Language Meetup - Async functions
JavaScript The Language Meetup - Async functionsJavaScript The Language Meetup - Async functions
JavaScript The Language Meetup - Async functions
 
ES6 katas - talk given at enterjs
ES6 katas - talk given at enterjsES6 katas - talk given at enterjs
ES6 katas - talk given at enterjs
 
TDD for Kids - VLCjs (Valencia Spain, July 2015)
TDD for Kids - VLCjs (Valencia Spain, July 2015)TDD for Kids - VLCjs (Valencia Spain, July 2015)
TDD for Kids - VLCjs (Valencia Spain, July 2015)
 
TDD with Google Spreadsheets #enterjs 2015
TDD with Google Spreadsheets #enterjs 2015TDD with Google Spreadsheets #enterjs 2015
TDD with Google Spreadsheets #enterjs 2015
 
Baby steps
Baby stepsBaby steps
Baby steps
 
TDD with Google Spreadsheets
TDD with Google SpreadsheetsTDD with Google Spreadsheets
TDD with Google Spreadsheets
 
ECMAScript 6 for real
ECMAScript 6 for realECMAScript 6 for real
ECMAScript 6 for real
 
Day1 - TDD (Lecture SS 2015)
Day1 - TDD (Lecture SS 2015)Day1 - TDD (Lecture SS 2015)
Day1 - TDD (Lecture SS 2015)
 
react.js - DOM as it was meant
react.js - DOM as it was meantreact.js - DOM as it was meant
react.js - DOM as it was meant
 
Pixelplant - WebDev Meetup Salzburg
Pixelplant - WebDev Meetup SalzburgPixelplant - WebDev Meetup Salzburg
Pixelplant - WebDev Meetup Salzburg
 
Better Code through TDD
Better Code through TDDBetter Code through TDD
Better Code through TDD
 
April JavaScript Tools
April JavaScript ToolsApril JavaScript Tools
April JavaScript Tools
 
Presentation Mobile Monday Munich, March 2012
Presentation Mobile Monday Munich, March 2012Presentation Mobile Monday Munich, March 2012
Presentation Mobile Monday Munich, March 2012
 
Webtestsuite black berrydevcon
Webtestsuite black berrydevconWebtestsuite black berrydevcon
Webtestsuite black berrydevcon
 
EmbedJS
EmbedJSEmbedJS
EmbedJS
 
JavaScript Tools (PHPConference 2011, Berlin)
JavaScript Tools (PHPConference 2011, Berlin)JavaScript Tools (PHPConference 2011, Berlin)
JavaScript Tools (PHPConference 2011, Berlin)
 
WAC
WACWAC
WAC
 
NEXT11, Puzzle pieces of our mobile web approach
NEXT11, Puzzle pieces of our mobile web approachNEXT11, Puzzle pieces of our mobile web approach
NEXT11, Puzzle pieces of our mobile web approach
 
Java scriptgettingstarted
Java scriptgettingstartedJava scriptgettingstarted
Java scriptgettingstarted
 
Munichjs javascript
Munichjs javascriptMunichjs javascript
Munichjs javascript
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

Refactoring out of the mess