Paul M Jones presented at the Nashville PHP User Group on August 13th, 2012 on modernizing legacy code.
“We’ve all been there, dropped into a codebase that makes perfect sense to the original developers but might as well be Greek to you. Paul will help you make sense of things with some helpful tips for untangling the spaghetti and how to move it towards a more modern, modular architecture while keeping it running the whole time.”
Applying TDD to your PHP code is a big improve in your code as forces you to “think” the code before write it down. A common approach to TDD workflow could be:
- Write your test class
- Write your code that make pass the tests
- Refactor the code
If you take a closer look, between all the steps you MUST run all the tests for possible functionality breaks with every single change in the code, and make it manually could be a little disturbing.
So for this there are tools that helps you track your code for changes and if changed will automatically run a bunch of actions.