Test-infected!
you will probably become a Test-infected developer if you
try a unit testing framework!
but what is unit testing? “The basic concept of unit
testing is write more code which will test the main code we've written, by
"throwing" sample data at it and examining what it gets back.”-Harry Fuecks .
Some developers might not like the idea of writing more code but it will
save you a good time pin pointing the exact piece of code causing the problem
when your script becomes huge.
another advantage of unit testing is mock objects. a mock object is an object that simulates a difficult to set up or a time consuming object such as Database connection. say you had to develop a script which needs a connection to a database server that you don’t have yet and you have to start writing code! that’s where mock objects will save your life.
There are few UnitTesting frameworks for PHP. my favorite one is SimpleTest by Marcus Baker which I will demonstrate the most basic use of it in the article at DEVpapers.com.
Saleh Jamal
http://www.phpsimplicity.com
(Published in 28-5-2005 for Hotscripts.com newsletter - May issue)