Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

ddick (5726)

  (email not shown publicly)

I'm based out of Melbourne, Australia. I attend the excellent meetings whenever i get the chance, which is not often enough.

Journal of ddick (5726)

Tuesday September 29, 2009
07:50 PM

Devel::Cover and how to test inputs?

[ #39695 ]

I've been experimenting with the awesome Devel::Cover, and while it's great fun to use it to improve my test suite, my code also tries very hard to validate all input sources.

Devel::Cover can tell me that the line

$a == $b ? 1 : 0

has been executed and even that both halves of the condition have been executed, but it can't tell me that i haven't tested the case where $a isn't numeric.

I'm testing as much as i can think of, but i'm unwilling to bet that all inputs have been checked, and i can't think of a way to guarantee it

Which is considerably annoying, as a lot of these inputs wind up in a database and databases are very unforgiving about bad input

My test suite already parses the sql ddl statements, maps them to the correct classes and runs through null,min,max,max+1,min-1,etc tests for each field but can i guarantee that i've caught every instance in a large code base?

Probably not

And to look at it another way, does this matter?

And why the hell am i writing test cases to improve test suite coverage (58% and climbing! woohoo!) when i could be writing more features?

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.