Posts tagged ‘code’

Steps toward modernizing a legacy codebase

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.”

Test your code with every change in your PHP files

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:

  1. Write your test class
  2. Write your code that make pass the tests
  3. 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.