# Code Refurbishment

DevFeed: [Code Refurbishment](<https://devfeed.tech/articles/code-refurbishment-13611.md>)

Original publisher: [Read original article](<https://mechanical-sympathy.blogspot.com/2011/08/code-refurbishment.html>)

Author: Martin Thompson (noreply@blogger.com)

Published: 2011-08-20T16:02:00Z

Content type: opinion

Language: en

Sources: [Mechanical Sympathy](<https://devfeed.tech/sources/mechanical-sympathy.md>)

Topics: [Refactoring](<https://devfeed.tech/topics/refactoring.md>), [Code](<https://devfeed.tech/topics/code.md>), [Code quality](<https://devfeed.tech/topics/code-quality.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [code-quality](<https://devfeed.tech/tags/code-quality.md>), [ddd](<https://devfeed.tech/tags/ddd.md>), [refactoring](<https://devfeed.tech/tags/refactoring.md>), [refurbishment](<https://devfeed.tech/tags/refurbishment.md>), [tests](<https://devfeed.tech/tags/tests.md>), [unit-tests](<https://devfeed.tech/tags/unit-tests.md>)

## AI overview

The article distinguishes refactoring from broader structural redevelopment. It defines refactoring as behavior-preserving changes that improve code structure, quality, and maintainability, while noting that larger changes may reuse existing code without being a complete rewrite.

## Source excerpt

Within our industry we use a huge range of terminology. Unfortunately we don't all agree on what individual terms actually mean. I so often hear people misuse the term "Refactoring" which has come to make the business in many organisations recoil in fear. The reason for this fear I've observed is because of what people often mean when misusing this term. I feel we are holding back our industry by not being disciplined in our use of terminology. If one chemist said to another chemist "we are about to perform titration", both would have a good idea what is involved. I believe computing is still a very immature science. As our subject matures hopefully we will become more precise and disciplined in our use of terminology and thus make our communication more accurate and effective. Refactoring is a very useful technique for improving code quality and clarity. To be precise it is a behaviour preserving change that improves a code base for future maintenance and understanding. A good example would be extracting a method to remove code duplication and applying this method at every site of the duplication, thus removing the duplication. Refactoring was first discussed in the early 1990s and became mainstream after Martin Fowler's excellent "Refactoring" book in 1999. Refactoring involves making a number of small internal changes to the code structure. These changes will typically not have any external impact. Well written unit tests that just assert externally observable behaviour will not change when code is refactored. If the external behaviour of code is changing when the structure is being changed then this is not refactoring. Now, why do our business folk recoil in fear when this simple and useful technique of "refactoring" is mentioned? I believe this is because developers are actually talking about a much more extensive structural redevelopment technique that does not have a common term. These structural changes are often not a complete ground-up rewrite because much