On 12/19/06, demerphq <[EMAIL PROTECTED]> wrote:
On 12/19/06, Nadim Khemir <[EMAIL PROTECTED]> wrote:
> >Personally I wouldn't get /too/ hung up about 100% test coverage - it
> >can be taken too seriously. See Brian Marick's "How to Misuse Code
> >Coverage" <http://www.testing.com/writings/coverage.pdf> for example.
>
> Thanks for the article link. I've seen bad test code with 100% coverage but
> I've never seen good test code with bad coverage. Also, I'd rather not have
> 98.7% coverage. It's nagging me and I'd rather spend five extra minutes to
> get 100%.

Hmm, well, if you are like me then ocassionally you will have branches
to handle "can't happen" cases in your code. Eliminating them makes
your code less robust as at some future time the can't happen just
might, but at the same time since they are can't happen cases you
can't really test them or get coverage for them. Some people go to
inordinate lengths to trigger these, and I have to say im not
convinced that its time well spent.

It'd be nice if there were a pragma or function for use by
Devel::Cover which said just that:

 cond ? ... :
 cond ? ... :
 cond ? ... :
 can't::happen;

 sub can't::happen { Carp::confess q[This can't happen] }

Josh

Reply via email to