in reply to testing code

I'm wondering what your favorite test modules are, and how you go about testing (or if you don't).

Various monks have already written a fair bit on this very topic - see Perl Testing and Quality Assurance and What goes in a test suite? for some links.

Does anyone actually write the tests before you do the coding?

I think I've already answered that one :-)