Wednesday, June 22, 2011

Importance of Unit Testing in Software Development

In the programming world, Unit Testing is considered a religious issue that has many takers. Some vigorously for it, and some vehemently against it too.

A StackOverFlow query was answered in good spirit and (put pretty well !) and the explanation goes thus:

“Unit testing is a lot like going to the gym. You know it is good for you, all the arguments make sense, so you start working out. There’s an initial rush, which is great, but after a few days you start to wonder if it is worth the trouble.”

Just like the popular JUnit framework (for Java), the PHP world has PHPUnit (thanks to Sebastian Bergmann), a popular Unit Testing framework, that is not just feature-rich but quite extensible too.

Supporting custom configurations, PHPUnit is extensively used for the seldom used open-source applications, but more notably, its the first choice for quite a few well established frameworks (read Symfony) that command respect and a large fan-following. Further, its supported by some pretty big names for e.g. Zend (the basic engine behind PHP) or Ubuntu for that matter (which is the de-facto Linux distribution for a few years in a row).

For those living on the edge, exotic combinations of testing frameworks have allowed people to bring relatively niche concepts like Continuous Integration to PHP using free tools like Hudson (a.k.a Jenkins) and Phing. Integrating popular Revision Control systems (GitHub / FogBugz) as well as GUI testing frameworks (for e.g. Selenium), PHPUnit’s maturity speaks for itself.

No comments:

Post a Comment

ShareThis

Bookmark and Share