in reply to Stopgap measures when you don't have a QA department

If you are having trouble finding Class::Contract, you can go here and download it directly. You should also check out clemburg's Test::Unit as well as other testing related modules.
  • Comment on Re (tilly) 1: Stopgap measures when you don't have a QA department

Replies are listed 'Best First'.
Re: Re (tilly) 1: Stopgap measures when you don't have a QA department
by jackdied (Monk) on Oct 19, 2001 at 02:05 UTC
    I've used Test::Unit, and really like it. One of the nice things about perl is that it is very good language for writing self-testing routines in.

    When you can, have the tests run outside the production environment. This isn't doable for everything, but offload as much as you can to 'make test' and 'make check' kinda tests.

    Another good place to test modules is when they are loaded. Have modules register with a central module to announce themselves, when they call GateKeeper::register() use the caller(0) information to perform any runtime tests on the newly loaded module

    package GateKeeper; use strict; my $package_list = {}; sub register { my ($package) = caller(); perform_tests($package); # ensure all required subs are defined $package_list->{$package} = $package->cvs_version(); # cvs_version( +) sub is tested in perform_tests } # other subs to query cvs version info and other fun stuff
    Someday I plan on posting a more complete version of registration and testing of virtual interfaces to PM, but today isn't going to be that day.

    -jackdied