SlideShare a Scribd company logo
Refactoring Aman & Chirag ThoughtWorks Pune
If it ain’t broken, why fix it?
Good programmers write code that humans can understand
You write code once; it gets read many times
To regain control on a program that is getting out of hands
To make the next change easier
This brings us to  Refactoring
Refactoring in Action
Code Smells
Duplicated Code
Long Method
Comments
Divergent Change
Shotgun Surgery
Feature Envy
Lazy Class
Switch Statements
Primitive Obsession
Method Chains
Refactoring Catalog
Refactoring Catalog Composing methods
 
 
 
 
 
 
Refactoring Catalog Simplifying Conditional Expressions
 
 
 
 
 
 
 
Refactoring Catalog Making Method Calls Simpler
 
 
 
 
Accompanying XP Practices TDD : “Red - Green - Refactor” mantra Continuous Integration Collective Code Ownership Pair Programming
Next steps for you Go read the book!!! Practice small refactorings Explore the “Refactor” menu of your IDE Keep a look out for code smells in your project
To sum it up… Refactoring is a good technique to clean up code Refactoring leads to better design (especially with Test-Code-Refactor cycles) Most important of all: it leaves a nice feeling at the end of it all!
Thank You Aman King [email_address] Chirag Doshi [email_address]

More Related Content

PDF
Test Driven Development
PDF
Walmyr Filho - Lessons learned as software engineer working at appear.in
PPTX
Debugging
PPTX
Introduction to computer science
PDF
Seven Ineffective Coding Habits of Many Java Programmers
PDF
Good code, Bad Code
PDF
Seven Ineffective Coding Habits of Many Programmers
PDF
TDD Flow: The Mantra in Action
Test Driven Development
Walmyr Filho - Lessons learned as software engineer working at appear.in
Debugging
Introduction to computer science
Seven Ineffective Coding Habits of Many Java Programmers
Good code, Bad Code
Seven Ineffective Coding Habits of Many Programmers
TDD Flow: The Mantra in Action

Similar to Refactoring (20)

PPTX
refactoring code by clean code rules
ODP
Refactoring: Improving the design of existing code
PDF
Code Refactoring in Software Development
PPTX
Refactoring
ODP
Refactoring Dojo @AgileWorks Bucharest 21 May 2014
PPTX
Eurosport's Kodakademi #2
PPTX
Code refactoring
PPTX
Refactoring
PPTX
Code Refactoring using rails
PPTX
Speeding up web_application
PPTX
Code Refactoring
PPTX
SAD10 - Refactoring
PDF
Codesmells for AspectJ
PPTX
Refactoring
PPTX
Tech talks#6: Code Refactoring
PDF
Refactoring 2TheMax (con ReSharper)
PDF
agile refactoring and integration techniques.pdf
PPTX
Refactoring code in .net
PDF
The Power Of Refactoring (php|tek 09)
PPTX
Metric driven refactoring
refactoring code by clean code rules
Refactoring: Improving the design of existing code
Code Refactoring in Software Development
Refactoring
Refactoring Dojo @AgileWorks Bucharest 21 May 2014
Eurosport's Kodakademi #2
Code refactoring
Refactoring
Code Refactoring using rails
Speeding up web_application
Code Refactoring
SAD10 - Refactoring
Codesmells for AspectJ
Refactoring
Tech talks#6: Code Refactoring
Refactoring 2TheMax (con ReSharper)
agile refactoring and integration techniques.pdf
Refactoring code in .net
The Power Of Refactoring (php|tek 09)
Metric driven refactoring
Ad

More from Naresh Jain (20)

PDF
Problem Solving Techniques For Evolutionary Design
PDF
Agile India 2019 Conference Welcome Note
PDF
Organizational Resilience
PDF
Improving the Quality of Incoming Code
PDF
Agile India 2018 Conference Summary
PDF
Agile India 2018 Conference
PDF
Agile India 2018 Conference
PDF
Agile India 2018 Conference
PDF
Pilgrim's Progress to the Promised Land by Robert Virding
PDF
Concurrent languages are Functional by Francesco Cesarini
PDF
Erlang from behing the trenches by Francesco Cesarini
PDF
Anatomy of an eCommerce Search Engine by Mayur Datar
PDF
Setting up Continuous Delivery Culture for a Large Scale Mobile App
PDF
Towards FutureOps: Stable, Repeatable environments from Dev to Prod
PDF
Value Driven Development by Dave Thomas
PDF
No Silver Bullets in Functional Programming by Brian McKenna
PDF
Functional Programming Conference 2016
PDF
Agile India 2017 Conference
PDF
The Eclipse Way
PDF
Unleashing the Power of Automated Refactoring with JDT
Problem Solving Techniques For Evolutionary Design
Agile India 2019 Conference Welcome Note
Organizational Resilience
Improving the Quality of Incoming Code
Agile India 2018 Conference Summary
Agile India 2018 Conference
Agile India 2018 Conference
Agile India 2018 Conference
Pilgrim's Progress to the Promised Land by Robert Virding
Concurrent languages are Functional by Francesco Cesarini
Erlang from behing the trenches by Francesco Cesarini
Anatomy of an eCommerce Search Engine by Mayur Datar
Setting up Continuous Delivery Culture for a Large Scale Mobile App
Towards FutureOps: Stable, Repeatable environments from Dev to Prod
Value Driven Development by Dave Thomas
No Silver Bullets in Functional Programming by Brian McKenna
Functional Programming Conference 2016
Agile India 2017 Conference
The Eclipse Way
Unleashing the Power of Automated Refactoring with JDT
Ad

Recently uploaded (20)

PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
TLE Review Electricity (Electricity).pptx
PPTX
Tartificialntelligence_presentation.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Unlocking AI with Model Context Protocol (MCP)
PPT
Teaching material agriculture food technology
PPTX
Spectroscopy.pptx food analysis technology
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PPTX
Machine Learning_overview_presentation.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
A comparative study of natural language inference in Swahili using monolingua...
Network Security Unit 5.pdf for BCA BBA.
TLE Review Electricity (Electricity).pptx
Tartificialntelligence_presentation.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Advanced methodologies resolving dimensionality complications for autism neur...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Assigned Numbers - 2025 - Bluetooth® Document
Unlocking AI with Model Context Protocol (MCP)
Teaching material agriculture food technology
Spectroscopy.pptx food analysis technology
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Heart disease approach using modified random forest and particle swarm optimi...
Machine Learning_overview_presentation.pptx
Machine learning based COVID-19 study performance prediction
Univ-Connecticut-ChatGPT-Presentaion.pdf
A Presentation on Artificial Intelligence
NewMind AI Weekly Chronicles - August'25-Week II
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

Refactoring