Copyright © Philip M. Parker, INSEAD. Terms of Use.

| Domain | Definition |
Computing | Refactoring |
Source: compiled by the editor from various references; see credits. | |
(From Wikipedia, the free Encyclopedia)
Refactoring is the process of rewriting written material to improve its readability or structure, with the explicit purpose of keeping its meaning or behavior.
Refactoring is the part of code maintenance which doesn't fix bugs or add new functionality. Rather it is designed to improve the understandability of the code or change its structure and design, to make it easier for human maintenance in the future. In particular, adding new behavior to a program might be difficult with the program's given structure, so a developer might refactor it first to make easy, and then add the new behavior.
The term is by analogy with the factorization of numbers and polynomials. For example, can be factored as , revealing an internal structure that was previously not visible (such as the two zeroes at +1 and -1). Similarly, in software refactoring, the change in visible structure can often reveal the "hidden" internal structure of the original code.
Refactoring is done as a separate step, to simplify testing. At the end of the refactoring, any change in behavior is clearly a bug and can be fixed separately from the problem of debugging the new behavior.
An example of a trivial refactoring is to change a variable name into something more meaningful, such as from a single letter 'i' to 'interestRate'. A more complex refactoring is to turn the code within an if block into a function. An even more complex refactoring is to replace an if conditional with polymorphism. While "cleaning up" code has happened for decades, the key insight in refactoring is to intentionally "clean up" code separately from adding new functionality, using a known catalogue of common useful refactoring methods, and then separately testing the code (knowing that any behavioral changes indicate a bug). The new aspect is explicitly wanting to improve an existing design without altering its intent or behavior.
Refactoring is an important aspect of extreme programming.
The book Refactoring [1] is the classic reference. Although refactoring code has been done informally for years, William F. Opdyke's 1993 PhD dissertation [4] is the first known paper to specifically examine refactoring. All of these resources provide a catalog of common methods for refactoring; a refactoring method has a description of how to apply the method and indicators for when you should (or should not) apply the method.
Refactoring is such an important concept that it has been identified as one of the most important software innovations.
Many refactorings are meant to cure the ills listed in [5].
This section is originally from Perl Design Patterns Book
To refactor text, in a WikiWiki, is to rewrite and often to reorganize the text completely or radically, sometimes dramatically shortening it, but in a way that preserves all the important, relevant content. In a WikiWiki, it is usually discussions that are refactored--with the purpose of making the discussion accessible to someone who is interested in the arguments made in the discussion, and the information to be gleaned from it, rather than the history of the discussion itself. Refactoring is critically important process in developing and maintaining the Wikipedia
Obviously, refactoring is difficult to do in such a way that will make all participants in a discussion happy. It requires intelligence, tact, excellent reading comprehension skills, good writing skills, and a lack of bias.
Several good discussions are found at the WikiWeb at c2.org.
For policy on refactoring in Wikipedia, see editing policy. In the context of Wikipedia, usually talk pages are refactored, but occasionally, when an article has been developed in a particularly haphazard way, it needs to be changed so radically that the resulting change can be called a refactoring.
Refactoring Code
The term refactoring is often used to describe modifying source code without changing its external behavior, and is sometimes informally referred to as "cleaning it up." In this case, refactoring is part of the cycle of create and test code, refactor and test code, add new behavior and test code, refactor and test code, add new behavior and test code, and so on. Testing ensures that the code still does what it is supposed to.Break down large functions
Functions that grow in use also grow in size. After a certain point, it becomes
clear that functions can benefit from using functions themselves. Your eyes probe
the function looking for a likely candidate to relocate elsewhere. This candidate
is chosen for being the largest stretch of code that really has nothing to do
with the enclosing function. This lets us easily think up a name that explains
what the new function does without having to resort to something contrived just
to distinguish it from the original function.Refactoring other Text
The term refactoring originated in computer programming, but the concept has also been applied when modifying any text.External links and bibliography
Source: adapted by the editor from Wikipedia, the free encyclopedia under a copyleft GNU Free Documentation License (GFDL) from the article "Refactoring."
| The following statistics estimate the number of searches per day across the major English-language search engines as identified by various trade publications. Hyperlinks lead to commercial use of the expression at Amazon.com. |
| Expression | Frequency per Day |
refactoring | 13 |
| Source: compiled by the editor from various references; see credits. | |
Scrabble® Enable2K-Verified Anagrams | |
| Words within the letters "a-c-e-f-g-i-n-o-r-r-t" | |
-1 letter: refracting, refraction. | |
-2 letters: cratering, factoring, fornicate, recrating, retracing, terracing. | |
-3 letters: anoretic, anterior, argentic, carrotin, catering, craftier, crafting, creating, creation, faceting, fraction, frontage, frontier, gerontic, infector, orangier, reacting, reaction, refacing, tricorne. | |
-4 letters: aconite, acrogen, anergic, angrier, argotic, carotin, carrion, carting, ceratin, certain, cigaret, cirrate, coagent, coating, cognate, coinage, coinfer, cointer, conifer, coreign, cornier, crating, creatin. | |
| Words containing the letters "a-c-e-f-g-i-n-o-r-r-t" | |
+2 letters: ferromagnetic. | |
+3 letters: cotransferring. | |
+4 letters: reconfiguration. | |
+5 letters: reconfigurations. | |
| Source: compiled by the editor from various references; see credits. SCRABBLE® is a registered trademark. All intellectual property rights in and to the game are owned in the U.S.A and Canada by Hasbro Inc., and throughout the rest of the world by J.W. Spear & Sons Limited of Maidenhead, Berkshire, England, a subsidiary of Mattel Inc. Mattel and Spear are not affiliated with Hasbro. | |
Hexadecimal (or equivalents, 770AD-1900s) (references)52 45 46 41 43 54 4F 52 49 4E 47 |
| Leonardo da Vinci (1452-1519; backwards) (references)
|
| American Sign Language (origins from 1620-1817 in Italy and, especially, France) (references)
|
| Semaphore (1791, in France) (references)
|
| Braille (1829, in France) (references)
|
Morse Code (1836) (references).-. . ..-. .- -.-. - --- .-. .. -. --. |
| Dancing Men (Sir Arthur Conan Doyle, 1903) (references)
|
Binary Code (1918-1938, probably earlier) (references)01010010 01000101 01000110 01000001 01000011 01010100 01001111 01010010 01001001 01001110 01000111 |
HTML Code (1990) (references)R E F A C T O R I N G |
ISO 10646 (1991-1993) (references)0052 0045 0046 0041 0043 0054 004F 0052 0049 004E 0047 |
| British Sign Language (Fingerspelling, BSL; 1992, British Deaf Association Dictionary of British Sign Language) (references)
|
Encryption (beginner's substitution cypher): (references)5239403537544952434841 |
| 1. Expressions: Internet 2. Anagrams 3. Orthography 4. Bibliography |
Copyright © Philip M. Parker, INSEAD. Terms of Use.