Refactoring - Word Analysis
This is a mind map talking about the word - refactoring. You can create a mind map like this effortlessly.
Similar Mind Maps
What is it?
(verb) restructuring software preserving its observable behaviour
(noun) small, behaviour preserving transformation
not to be confused with
Refactoring preserves behaviour; rewriting often changes it
Refactoring incrementally changes existing code; rewriting usually replaces large sections from scratch
We can release code in the middle of a refactoring; rewriting tends to be an "all or nothing" situation
Refactoring can start with little design up-front; rewriting normally requires more design in advance
"[Refactoring] is revision, but it isn’t doing the work over." (Ron Jeffries)
How & When?
"identifying a specific problem with code, envisioning how to improve it, then improving it in small, reversible steps" (JB Rainsberger)
catalog of code smells
catalog of refactorings
Three strikes and you refactor.
Done continuously, as part of implementing a feature
We take the next feature that we are asked to build, and instead of detouring around all the weeds and bushes, we take the time to clear a path through some of them (Ron Jeffries)
No "refactoring stories" in the backlog
Reasons to do this crazy thing
Reducing volatility in the cost of new features (JB Rainsberger)
"Refactoring: Improving the Design of Existing Code", by Martin Fowler
"Refactoring to Patterns", by Joshua Kerievsky
"Refactoring Databases: Evolutionary Database Design", by Scott Ambler
"Refactoring Workbook", by WIlliam Wake
Work experience versus Refactoring to Design Patterns: A Controlled Experiment (Ng, 2006)
Would refactoring a program using design patterns (in)conclusivly supersede the effect of work experience to guide maintainers to complete a maintenance task, or vice versa?
To complete a maintenance task of perfective nature, the time spent even by the inexperienced maintainers on a refactorized version is much shorter than that of the experienced subjects on the original version
Are Refactorings Less Error-prone Than Other Changes? (Weißgerber, 2006)
The goal of this study is to see whether the common belief, that refactorings are less risky than other changes, is really true.Our heuristics is to assume that a bug may be caused by changes that have been done in a time window of n days before the bug has been opened.
Although we found interesting correlations between refactorings and bug reports, we are aware that these could be accidental or caused by other factors.
On the Relation of Refactoring and Software Defects (Ratzinger, 2008)
we discovered that refactorings and defects have an inverse correlation: The number of software defects decreases, if the number of refactorings increased in the preceding time period
A Field Study of Refactoring Challenges and Benefits (Kim, 2014)
Conducted at Microsoft. Based on qualitative survey of developers and quantitative analysis of Windows 7 code.
refactoring changes are likely to be relatively more reliable than regular changes in a large system
The refactoring definition in practice seems to differ from a rigorous academic definition of behavior-preserving program transformations
survey participants perceived that refactoring involves substantial cost and risks
significant reduction in the number of inter-module dependencies and the number of post-release defects.
How We Refactor, and How We Know It (Murphi-Hill, 2009)
large study of developer's refactoring habits
most refactorings are performed in batches, repeating similar refactorings
Commit Messages don't predict Refactorings. We suspect this because refactoring may be an unconscious activity
programmers frequently "floss refactor", that is, they interleave refactoring with other types of programming activity, to keep the code healthy.
About half recactorings are Medium and Low-level
High level refactorings are those that change the signatures of classes, methods, and fields
Rename Class, Move Static Field, Add Parameter
Medium level refactorings are those that change the signatures of classes, methods, and fields and also significantly change blocks of code
Extract Method, Inline Constant, Convert Anonymous Type to Nested Type
Low level refactorings are those that make changes to only blocks of code
Extract Local Variable, Rename Local Variable, Add Assertion
refactorings are performed frequently
he kind of refactoring performed with tools differs from the kind performed manually
impact on Quality
Empirical investigation of refactoring effect on software quality (Alshayeb, 2008)
The goal of this paper is to quantitatively assess, using software metrics, the effect of refactoring on different external quality attributes, which are: adaptability, maintainability, understandability, reusability, and testability in order to decide whether the cost and time put into refactoring are worthwhile.--Experiment consisted in applying some (arbitrary) refactorings to existing codebases.
We found that refactoring improved a quality attribute in some classes, only to reversely weaken that same quality attribute in other classes of the same system. We thus are unable to validate that refactoring as a whole practice improves software quality.
An Empirical Assessment of Refactoring Impact on Software Quality Using a Hierarchical Quality Mode (Shatnawi, 2011)
* four software quality factors: reusability, flexibility, extendibility, and effectiveness* we aim to identify refactoring heuristics that establish the relationship between software refactoring and software quality.
different refactorings impact quality factors in different ways, some improving quality and some deteriorating quality
Reusability is the quality factor that has the largest number of positives (65%). This tells us that most refactoring activities change classes to have the appropriate responsibilities and make the design more reusable.
The effectiveness improves for 42% of the refactorings, whereas it deteriorates for 9% only.
The refactorings improve flexibility and extendibility of a system more than otherwise
most refactoring heuristics improve the four quality factors.
developers can use particular refactorings to improve particular aspects of quality (goal-driven refactoring heuristics)
An Empirical Evaluation of Impact of Refactoring On Internal and External Measures of Code Quality (Kannangara, 2015)
Ten refactoring techniques were evaluated through experiments to assess external measures: Resource Utilization, Time Behaviour, Changeability and Analysability which are ISO external quality factors and five internal measures: Maintainability Index, Cyclomatic Complexity, Depth of Inheritance, Class Coupling and Lines of Code.
The result of external measures did not show any improvements in code quality after the refactoring treatment. However, from internal measures, maintainability index indicated an improvement in code quality of refactored code than non-refactored code and other internal measures did not indicate any positive effect on refactored code.
Results seem "statistically inconclusive"