Testing's been discussed quite a bit on perlmonks in the past. Take a look at:
In reply to Re^4: Difficult code (Resolutions) by adrianh in thread Difficult code (Resolutions) by xChauncey