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

PHPKitchen:
What is Unit Testing?
Jun 20, 2005 @ 12:10:58

On PHPKitchen today, there's this new posting that can answer the question "just what is usint testing?"

You might be surprised to hear that some developers have no idea what unit testing is - I know I was, but I have recently spoken to a suprising number of people who had never run across the 'concept'.

For a good overview of the SimpleTest framework check out this excellent introductory article (cancel the print dialogue, this view is easier to read than the paged one), before heading over to Marcus' extensive docs on the SimpleTest website. SimpleTest is also available as a PEAR package which can be downloaded from the SF site.

Unit testing is the process by which, through some extra code in your application, you test the main code by handing it sample data and checking what it returns. Not only can thi sbe a handy way to debug an application, but it can keep you from passing around way too much data when you don't really need to.

Give it a try, see if you get addicted, can test-driven development work for your organisation? Also be sure check out Mock objects for help with isolating layers and resources in your application.

tagged:

Link:


Trending Topics: