There is a fantastic article on the subject linked to from this item by Justin Gehtland. I really like how the Justin equates unit testing to the spell checker in Word. You shouldn’t have to wait until you are done with the document or, worse, wait until the client calls you to know that you misspelled something.