refactoring

refactoring

(object-oriented, programming)
Improving a computer program by reorganising its internal structure without altering its external behaviour.

When software developers add new features to a program, the code degrades because the original program was not designed with the extra features in mind.

This problem could be solved by either rewriting the existing code or working around the problems which arise when adding the new features. Redesigning a program is extra work, but not doing so would create a program which is more complicated than it needs to be. Refactoring is a collection of techniques which have been designed to provide an alternative to the two situations mentioned above.

The techniques enable programmers to restructure code so that the design of a program is clearer. It also allows programmers to extract reusable components, streamline a program, and make additions to the program easier to implement.

Refactoring is usually done by renaming methods, moving fields from one class to another, and moving code into a separate method.

Although it is done using small and simple steps, refactoring a program will vastly improve its design and structure, making it easier to maintain and leading to more robust code.

"Refactoring, Reuse & Reality" by Bill Opdyke.

"Refactoring, a first example" by Martin Fowler.
This article is provided by FOLDOC - Free Online Dictionary of Computing (foldoc.org)

refactor

To improve the quality of code in a program. Refactoring does not alter the functionality of the software; but makes it more readable and maintainable for future changes.
Copyright © 1981-2025 by The Computer Language Company Inc. All Rights reserved. THIS DEFINITION IS FOR PERSONAL USE ONLY. All other reproduction is strictly prohibited without permission from the publisher.
Mentioned in
Copyright © 2003-2025 Farlex, Inc Disclaimer
All content on this website, including dictionary, thesaurus, literature, geography, and other reference data is for informational purposes only. This information should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional.