Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
17 views

Refactoring: Improving The Design of Existing Code: Review by Akshay G Rao

The document discusses refactoring which is defined as improving the design of existing code without changing its external behavior, some advantages of refactoring include improving design, making code easier to understand and helping find bugs, and it provides best practices for refactoring as well as when refactoring should and should not be attempted.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Refactoring: Improving The Design of Existing Code: Review by Akshay G Rao

The document discusses refactoring which is defined as improving the design of existing code without changing its external behavior, some advantages of refactoring include improving design, making code easier to understand and helping find bugs, and it provides best practices for refactoring as well as when refactoring should and should not be attempted.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 7

REFACTORING: IMPROVING

THE DESIGN OF EXISTING


CODE
Review by AKSHAY G RAO
Name:
REFACTORING: IMPROVING THE
DESIGN OF EXISTING CODE

Authors:
Martin Fowler

Contributors:
Kent Beck, John Brant, William
Opdyke, Don Roberts

Link:
https://drive.google.com/open?id=1eyG
WCdiCwY-
LW4ayYKnkkreEZvfmm0Mr
What is Refactoring
• Refactoring is the process of changing the internal structure of the
software system in a way that the external behavior of the code won’t
change.

Advantages of refactoring:
• Refactoring improves design of existing code.
• Refactoring makes software easier to understand
• Refactoring helps find bugs
• Refactoring helps program faster
When should you refactor
• Refactoring should be done majorly during two distinct activities of development
1. Before adding a functionality
2. After adding functionality.

Problems with refactoring


• Refactoring is hard to perform on databases.
• Refactoring is not easy while using published interfaces.

When shouldn’t we refactor


• Refactoring shouldn’t be attempted when you are close to a deadline
• Refactoring is not encouraged when the existing code is extremely unstructured
and doesn’t work on all test cases.
BAD PROGRAMMING PRACTICES
• Duplication of Code
• Long Method
• Large Class
• Long Parameter List
• Divergent Change
• Shotgun Surgery
• Feature Envy
• Switch Statements
• Message Chains
• Lazy Class
• Middle Man
Conclusion
• The author illustrates various principles to perform refactoring in a step-
by-step manner.
• The author has described the role of refactoring in many large complex
systems that he had dealt with and has illustrated various implementation
techniques available to solve a given problem.
• The author has provided parts of the puzzle in the form of catalogs and a
list of refactoring strategies. It is up to the reader to glue all the parts
together in right proportions as per circumstances and build a good
system.
THANK YOU

References
• Refactoring Browser Tool: https://refactory.com/refactoring-browser/
• Thesis paper of William F.Opdyke:
https://laputan.org/pub/papers/opdyke-thesis.pdf

You might also like