|Think about Loose Coupling|
thanks Amblikai to had asked that question! seriously.
Personally i'm sticked many step behind you, i'm still approaching the Test quest and what i noticed is some lack in documentation on this subject. Not in the sense that are not explained all features of Perl's testing possilities nor we dont have good books covering the matter.
I'm speaking about habits (as choroba said) or change of perspective testing imply. Beacuse of this i'm very happy to read Your Mother 's, wee's and tye's answers.
I think Test and the mind change it implies is a crucial breakpoint in the Perl learning curve (i'm still before such breackpoint) and tell the difference between who learned the language and who can use it effectively and, shall say, profesionally.
I would like to see a red warning in all Perl Test docs like:Warning: testing an existing program not planned to be tested is a quite diccult task you should avoid.
In such panorama I'had found very intriguing the Modulino idea by brian_d_foy.
As major shift of habit, you can think about your code in a 'distribution' way; not only tests but docs and installation facilities too. This multiply the workload by a factor 3 but then you have really good code, maintenable and usable by others.
I'll like to see more example and answer in this thread so we can point other monks to it in the future.
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.