refactoring
Pronunciation: ree-FAK-ter-ing
The process of restructuring existing source code—changing its internal structure without altering its external behaviour—to improve readability, maintainability, or performance.
Full Definition
Refactoring is a disciplined technique for improving the design of existing code without changing what the code does from the user's perspective. Common refactoring actions include renaming variables for clarity, extracting repeated logic into reusable functions, and simplifying complex conditional statements. In documentation, 'refactoring' is a gerund (verbal noun) and should not be confused with rewriting or debugging. Editors should note that 'refactor' is widely used as both a noun and verb in the industry ('we did a refactor'; 'we refactored the module') and both usages are acceptable in semi-formal developer content.
Usage
Usage note: Do not conflate with rewriting (which changes functionality) or debugging (which fixes errors). 'Refactor' as a verb is standard industry usage.
In Context
- "The sprint included two days of refactoring to reduce technical debt before the next feature cycle." — Engineering blog post
- "Refactoring the authentication module improved test coverage from 42% to 89%." — Code review summary