Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

QaFoo Blog:
How to Refactor Without Breaking Things
Jun 09, 2016 @ 20:31:50

On the QaFoo blog there's a new post sharing some helpful hints that you can use to refactor your code without breaking things in a legacy codebase.

Refactoring means to change the structure of your code without changing its behavior. It is an essential part of everyday programming and should become knee-jerk for your whole development team. Refactoring is very helpful to cleanup feature spikes, revise earlier decisions and keep a maintainable codebase in the long run. In a perfect project world - with extensive automated tests of various types - this is just a matter of getting used to. But there are only very few such projects. So getting into proper refactoring is much harder. This article will show you important tips to master this challenge with your team.

They point out two things that can help you ensure you break as little as possible: good tests and "baby steps". They go into a bit more detail on these two sections, mentioning how they help with the refactoring process and techniques to follow in the process.

tagged: refactor break functionality tests babysteps tutorial

Link: https://qafoo.com/blog/085_how_to_refactor_without_breaking.html