Devel::Cover and how to test inputs?

ddick on 2009-09-30T00:50:12

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?