Narendra Dhami

My Site

Archive for October, 2010

Setting up continuous integration for PHP using Hudson and Phing

Posted by Narendra Dhami on October 13, 2010

he difficulty with Unit Testing is keeping it up. It is very easy to slip into poor habits and before you know it there’s a huge chunk of code with no tests. Possibly a huge, badly designed chunk of code, that didn’t benefit from having tests written before it was coded. Before you know what’s going on, you end up with a project that you really can’t write tests for, because retrofitting the tests is near impossible.

For me, there are two critical reasons for Unit Testing:

  • Enforcing good design
  • To be able to write tests, you need to be able to zero in on a “unit” of code, isolating it from all the rest of your 1,000,000 lines of web application. Writing Unit Tests forces you to design systems that have loose coupling because otherwise it is impossible to test.

  • Allowing changes to be made in confidence
  • Without Unit Tests, you get to the point where no one really wants to make any changes to the code. This is especially true in a commercial environment, where many people have worked on the code, including some key team member who has since left. Unit Tests allow you to make changes to one part of the code and be pretty convinced you haven’t messed up something else.

    More …

    Posted in PHP | 1 Comment »

    The Seven Wastes of Software Development

    Posted by Narendra Dhami on October 7, 2010

    1. Partially Done Work
    2. Extra Features
    3. Relearning
    4. Handoffs
    5. Delays
    6. Task Switching
    7. Defects


    Posted in General | Leave a Comment »