SAFe Knowledge Base » Recommended Reading

Refactoring

You just have to have the guidance to lead you in the direction until you can do it yourself. It is the neglect of timely repair that makes rebuilding necessary.

—Richard Whately

Refactoring is an activity to improve a code or component's internal structure or operation without changing its external behavior. The goal of software development is the continuous delivery of business value to users and stakeholders. Constantly changing technology and evolving business objectives make maintaining and continuously increasing business value difficult. Two paths to the future exist:

  1. Keep adding new functionality to an existing code base toward an eventually unmaintainable “throw-away” state.
  2. Continuously modify the system to provide a foundation for efficiently delivering current and future business value.

The second choice, refactoring, is better. With continuous refactoring, the useful life of an Enterprise’s investment in software assets can be extended as long as possible. Users can continue to experience a flow of value for years to come. Refactors enable an emergent design, ensuring the system continues to meet future business needs. Refactors are a particular type of Enabler story in SAFe, and, like any other Story, they must be estimable, verifiable, and valuable, as well as accepted by the Product Owner.

Details

Figure 1 illustrates the fundamentals of refactoring, which is modifying any software entity—a module, method, or program—to improve its structure or viability without changing its external functionality.