Re: Phalanx: What if full coverage isn't possible?

2004-07-15 Thread James Mastros
Rocco Caputo wrote: On Sun, Jul 11, 2004 at 10:09:38PM +0200, James Mastros wrote: All unreachable code is either people misusing the term unreachable, a bug in Devel::Cover, or dead code that should be removed. Here's a puzzle, then. I just ran into a similar problem in POE::Driver::SysRW. For

Re: Phalanx: What if full coverage isn't possible?

2004-07-12 Thread James Mastros
Pete Krawczyk wrote: Consider the following code: $impclass ||= implementor($scheme) || do { require URI::_foreign; $impclass = 'URI::_foreign'; }; That's in URI.pm, lines 54-58. Devel::Cover treats that as a conditional. So short of deleting

Re: Phalanx: What if full coverage isn't possible?

2004-07-12 Thread stevan little
On Jul 11, 2004, at 4:09 PM, James Mastros wrote: package Foo; sub new { my $class=shift; $class=ref($class)||$class; bless [], $class; } eval { Foo::new(); } is($!, new dies when called as a function); Actually this doesn't die, it does even worse, given this code: package Foo; sub new {

Re: Phalanx: What if full coverage isn't possible? (fwd)

2004-07-11 Thread stevan little
On Jul 9, 2004, at 6:06 PM, Andy Lester wrote: Don't be mesmerized by 100% coverage. Agreed 100% here. However, I stand by my original statement that you CAN have 100% coverage on subroutines and pod. Any disagreement on that one? I agree with having 100% on subroutines, and I would add that

Re: Phalanx: What if full coverage isn't possible? (fwd)

2004-07-11 Thread Michael G Schwern
On Sun, Jul 11, 2004 at 12:26:44PM -0400, stevan little wrote: As for POD, in most cases, I agree with you, but to say you should have 100% POD coverage brings up several other questions, such as; Should I document private methods? IMPO yes, but Pod::Coverage (and thus Devel::Cover) will

Re: Phalanx: What if full coverage isn't possible? (fwd)

2004-07-11 Thread stevan little
Micheal, On Jul 11, 2004, at 2:09 PM, Michael G Schwern wrote: On Sun, Jul 11, 2004 at 12:26:44PM -0400, stevan little wrote: As for POD, in most cases, I agree with you, but to say you should have 100% POD coverage brings up several other questions, such as; Should I document private methods?

Re: Phalanx: What if full coverage isn't possible?

2004-07-10 Thread Danny R. Faught
Michael G Schwern wrote: Test coverage is a useful *heuristic* for test effectiveness. Like all heuristics if you push it too far it falls apart. Get as close to 100% as is useful and don't worry about the rest. Indeed. Brian Marick wrote a great paper on this topic - How to Misuse Code

Re: Phalanx: What if full coverage isn't possible? (fwd)

2004-07-09 Thread Andy Lester
There's a whole set of these sort of problems. sub new { my $proto = shift; my $class = ref $proto || $proto; In this case, we probably don't want that ANYWAY. That's what I did when I was through Data::Page for Leon Brocard, and it's now at 100% coverage, across the

Re: Phalanx: What if full coverage isn't possible?

2004-07-09 Thread Michael G Schwern
On Fri, Jul 09, 2004 at 12:10:52PM -0500, Pete Krawczyk wrote: Consider the following code: $impclass ||= implementor($scheme) || do { require URI::_foreign; $impclass = 'URI::_foreign'; }; That's in URI.pm, lines 54-58. Devel::Cover treats

Re: Phalanx: What if full coverage isn't possible?

2004-07-09 Thread Ricardo SIGNES
* Pete Krawczyk [EMAIL PROTECTED] [2004-07-09T13:10:52] Devel::Cover will always see that as a partial test, and never a full test: [ ... ] Is that a bug, then? Or is it something else? And how should I notate that, keeping in mind the goals of Phalanx, so that it's clearly visible that

Re: Phalanx: What if full coverage isn't possible? (fwd)

2004-07-09 Thread Michael G Schwern
On Fri, Jul 09, 2004 at 05:06:09PM -0500, Andy Lester wrote: There's a whole set of these sort of problems. Looking through a coverage analysis I just ran, here's some more idioms that trip up 100% coverage. my $foo = $bar || ''; my $foo = $bar || 1; $this ||

Re: Phalanx: What if full coverage isn't possible? (fwd)

2004-07-09 Thread Michael G Schwern
On Fri, Jul 09, 2004 at 06:31:09PM -0400, Michael G Schwern wrote: Looking through a coverage analysis I just ran, here's some more idioms that trip up 100% coverage. my $foo = $bar || ''; my $foo = $bar || 1; $this || return; Basically anything of the $foo ||

Re: Phalanx: What if full coverage isn't possible?

2004-07-09 Thread Michael Carman
On 7/9/2004 4:57 PM, Paul Johnson wrote: On Fri, Jul 09, 2004 at 12:10:52PM -0500, Pete Krawczyk wrote: Consider [code with unreachable path] Devel::Cover will always see that as a partial test, and never a full test: Is that a bug, then? That's for you to decide. The lack of coverage serves