Testing Perl scripts (not modules)

B

Bob

Sometimes I have rather large scripts. I have read up on testing
(Test::Simple etc.) but they all seam to deal with testing modules. Do
you test your scripts using the same stuff, do you not test scripts,
or is there another paradigm for testing scripts?

Robert
 
J

James Willmore

Sometimes I have rather large scripts. I have read up on testing
(Test::Simple etc.) but they all seam to deal with testing modules. Do
you test your scripts using the same stuff, do you not test scripts,
or is there another paradigm for testing scripts?

I usually create a test environment that I have as much control over,
execute the script and compare the results to the expected results. Salt
to taste :)

You can use one of the many Test::* modules to automate the task ... I
just find it easier to just run the sucker and see what happens ... in a
controlled environment.

Just a side note: if the scripts are that complex, you may want to think
about combining some common functionality into smaller scripts. The more
complex a script/application/etc. is, the more prone to unanticipated
failure it is. NTM the maintenance headache that one experiences later
on :)

HTH
--
Jim

Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.

a fortune quote ...
Anybody with money to burn will easily find someone to tend the
fire.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top