Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: What is a testing plan?

by t'mo (Pilgrim)
on Mar 02, 2006 at 04:25 UTC ( #533805=note: print w/replies, xml ) Need Help??

in reply to What is a testing plan?

One thing you might want to consider is that testing shouldn't just cover your expected outputs given certain inputs, but should also test the "behavior" of the code. Your tests should prove that the code behaves a certain way, e.g., that an object from Module::Foo delegates work to another object from Module::Bar.

A co-worker taught me that you can tell if your tests are of this type if you can describe each test using the word "should". For example, "Module::Foo should call Module::Bar::x", "should populate webpage template with values", "should throw exception if Oracle error code XYZ received", etc.

This shouldn't detract from having tests for the output, but from what I've seen recently, most tests involving actual data values (as opposed to behaviors) should be thrown in the "integration test" category.

Some relevant links:,

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://533805]
[Corion]: haukex: I've only now arrived at that revelation ;)
[Corion]: choroba: I use spod5, which also has that support, and also implements its own kinda-make stuff
[haukex]: But that module I just linked to assumes that most verbatim blocks are runnable code, I have other modules where that's not the case, so there I just copy-and-paste the synopsis into the author tests...
[haukex]: not the most efficient, but then again, I don't have that many modules on CPAN :-)
[Corion]: haukex: Yes, but if it's only supposed to run on my machine, I can be far more liberal with how I extract the code etc.
[Corion]: haukex: Yes - I see the benefit of using Dist::Zilla for people with 150+ modules on CPAN, but I don't see it for myself, and I'm always put off from contributing to such modules because they require a lot of toolchain setup that I don't want to ...
[Corion]: ... spend time on if I only want to provide a short patch
[haukex]: Corion: Yes exactly, in the author tests I don't worry about portability as much, I also don't list the author tests' dependencies in Makefile.PL
[haukex]: I figure someone who wants to contribute will know how to install the missing modules ;-) Not the nicest way to go but I don't think many people are using my modules yet

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (11)
As of 2017-02-27 12:37 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (385 votes). Check out past polls.