Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Perl modules with well written testing suites

by nuance (Hermit)
on Aug 23, 2000 at 20:11 UTC ( #29247=perlquestion: print w/replies, xml ) Need Help??

nuance has asked for the wisdom of the Perl Monks concerning the following question:

Hi Guys,

I'm shortly going to be involved in testing a large scale system, written in perl. I've got a couple of years experience in software testing, but I've never tested perl. I'm familiar with the basics of what I'm doing, but need to translate that "general knowledge" into "perl knowledge".

CPAN is massive and I assume that not everything is tested in an optimum manner. I could spend months trying to find something suitable. Is anyone familiar with the testing suites written for any of the CPAN modules? Specifically what I'm looking for is a couple of modules that I can examine to get a general gist of how to go about this task.

Can anyone recommend a module or two that I can go look at to get pointers in the right direction.

Thanks in advance.

Nuance

  • Comment on Perl modules with well written testing suites

Replies are listed 'Best First'.
(Ovid) Re: Perl modules with well written testing suites
by Ovid (Cardinal) on Aug 23, 2000 at 20:28 UTC
    Here's what I've come up with:

    I tried to pick out the ones that I thought would most likely fit what you're looking for, but I haven't actually used any of them. Unfortunately, I don't know that Perl has the testing suite support that's available for other products. I just haven't heard much in this area. If you find anything that looks really good, please post a follow-up.

    Good luck!

    Cheers,
    Ovid

Re: Perl modules with well written testing suites
by btrott (Parson) on Aug 23, 2000 at 20:20 UTC
    I was just working on this myself the other day, and I took a look at Storable and HTML::Embperl, if I remember correctly. They were helpful for getting down the basics of *how* to do it.

    It sounds more like your question might be *what* to do, though, ie. what exactly you should be testing. Perhaps? The most important reason for having a test suite, I think, is that it should test every important piece of your system. This allows for:

    • Easy portability testing; you have a defined set of tests that you can run on different platforms. If some fail, you know what you need to work on.
    • Version maintenance. If someone makes a change to the system, and it breaks a test when you next run the test suite, you know which change caused the problem, and where it broke in the test suite. This is very good for you, because you now have a better sense of what to fix.
    I realize that this isn't very specific, but really the specifics all deal with your particular system.
Re: Perl modules with well written testing suites
by BooK (Curate) on Aug 24, 2000 at 02:07 UTC

    Just a quick comment to add that, as an example, Test::Cmd is very useful. I am also planning to use a t/ directory, and following this example added a little clarity to the Test and Test::Harness man pages.

    I am not sure Benchmark is useful for (regression) testing. It is however, to finetune your code.

RE: Perl modules with well written testing suites
by knight (Friar) on Aug 23, 2000 at 21:26 UTC
    You also might want to take a look at Test::Cmd, which I created to try to factor out some underlying testing building blocks common to a number of utilities for which I was writing test suites. The intention is for you to subclass Test::Cmd to build up testing infrastructure that's particular to your command or system under test.

    In addition to providing some potentially useful testing infrastructure in its own right, it uses the standard Test module for its own internal tests, which might serve as a useful example.
RE (tilly) 1: Perl modules with well written testing suites
by tilly (Archbishop) on Aug 23, 2000 at 20:27 UTC
    I suggest starting by looking at Test and Benchmark.

    For examples with Test, virtually all CPAN modules come with a /t directory of tests that use it. Running that test suite is what "make test" is supposed to do.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://29247]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2022-01-22 18:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (63 votes). Check out past polls.

    Notices?