NAME

Test::TestCoverage - Test if your test covers all 'public' methods of the package

SYNOPSIS

use Test::TestCoverage;

test_coverage('My::Module');

my $obj = My::Module->new();
$obj->foo();
$obj->bar();

# test will be ok, assumed that My::Module has the methods new, foo and bar
ok_test_coverage('My::Module');

reset_test_coverage('My::Module');
reset_all_test_coverage();

test_coverage('My::Module');

my $obj = My::Method->new();
$obj->foo();

# test will be not ok, because bar is not invoked
ok_test_coverage('My::Module');

DESCRIPTION

If a module is written, the tests cover just a few methods of the module. This module aims to support the author in writing "complete" tests. If one of the "public" methods are missed in the testscript, the test ok_test_coverage will fail.

"private" methods are defined as methods that names begin with _ like _private_sub{...} and "public" is the opposite.

METHODS

test_coverage $module

Tells Test::TestCoverage for what module the coverage should be tested

ok_test_coverage $module

Checks if all "public" methods of $module were called in the testscript

reset_test_coverage $module

Resets the counter for all method invokations of $module's methods.

reset_all_test_coverage

Resets the counter for all methods of all modules that were registerd via test_coverage.

EXPORT

test_coverage, ok_test_coverage, reset_test_coverage, reset_all_test_coverage

SEE ALSO

Test::SubCalls, Test::Builder, Test::More

BUGS / TODO

There are a lot of things to do. If you experience any problems please contact me. At the moment the methods have to be invoked with full qualified names. Exported methods are not detected.

AUTHOR

Renee Baecker, <module@renee-baecker.de>

COPYRIGHT AND LICENSE

Copyright (C) 2006 by Renee Baecker

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.