Skip to content

Refactoring

Changing software’s internal structure while preserving its expected observable behaviour.

Software Development

What is refactoring?

Refactoring changes the internal structure of existing software while preserving its expected externally observable behaviour. Small, checkable steps help detect unintended changes. New features or a deliberately changed business rule are a separate task; they may accompany refactoring but should remain separately traceable.

In a fictional example, the same approval rule appears in several places. The team brings it together in a shared location and checks that permitted and rejected cases still behave as intended. The rule can then be changed centrally in future. Refactoring does not guarantee freedom from defects: desired behaviour and suitable checks must be clear first. Restructuring poorly understood rules merely because code is untidy can introduce new errors.

Sources

Articles on this topic

Software Development with ASES

Custom software, web and mobile apps