Devel::Cover recommendations... or maybe not?

Nik Clayton nik at ngo.org.uk
Fri Mar 16 08:56:06 GMT 2007


Tara Andrews wrote:
> On 3/15/07, Pete Sergeant <pete at clueball.com> wrote:
> OK, I'll bite.  How?
> 
> Seriously, a list of hints somewhere of "how to programmatically
> manufacture useful sets of edge cases" would be very useful to people
> who want complete testing for their software, but don't have a wizzo
> tester to get us from A to B.

Do you know about the failure conditions, and want to make sure that 
your code handles them?  Or do you want to find out what the failure 
conditions are?

If it's the former, one of Devel::Cover's reports shows you which 
branches of each conditional have been taken.  So if you have code like:

   open(my $fh, '<', 'some_file') or die "open(some_file): $!\n";

and you want to make sure that you've exercised the "can't open 
some_file" case in your test suite then Devel::Cover will tell you. 
Exercising this in the test suite is then hopefully relatively simple.

N




More information about the london.pm mailing list