Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^2: Does anybody write tests first?by andreas1234567 (Vicar) |
on Feb 22, 2008 at 11:32 UTC ( [id://669529]=note: print w/replies, xml ) | Need Help?? |
What helped is to move the functionality to modules, because IMHO modules are much neater to test than scripts.True, but it doesn't have to be like that. Keep the script, but encapsulate all code in subroutines except the last line below. The last line ensures that one can require the script without actually running its' contents. I argue that this script is no harder to test than a module.
-- Andreas
In Section
Seekers of Perl Wisdom
|
|