http://www.perlmonks.org?node_id=669628


in reply to Re^5: Does anybody write tests first?
in thread Does anybody write tests first?

unless you are testing more than one module from that test script (which I assume no one does)

Sorry this was unclear. When I wrote of a "simple sanity check before deployment", I actually did mean a test script that does nothing but use_ok over and over with no other tests.

When I've had a project with numerous modules, I have found it useful to have use_ok tests for all of them in one place.

my @modules = get_module_list(); plan 'tests' => scalar @modules; foreach my $module ( @modules ) { use_ok( $module ); }

If get_module_list() is bright enough to use File::Find, it will pick up modules without me having to explicitly list them. I get a sanity check on even those modules for which I haven't written more extensive tests. As I said, if your other testing isn't very good, checking that use works is a start.