David Cantrell wrote:
demerphq wrote:
On 9/15/05, David Landgren <[EMAIL PROTECTED]> wrote:
As I was downloading the newest version of Devel::Cover this morning, I
pondered on the concept of 1 Kwalitee point for coverage >= 80% ...
I have to wonder about how you handle modules that have code that is
Perl version dependent or OS dependent. Many non-trivial modules end
up having to work around one such incompatibility or another, and
therefore can't get full coverage on a single perl/OS combination.
You could argue that such modules should have their platform/version
specific bits in seperate modules, like what File::Spec does. I'd not
support that argument though - it would make stuff like ...
warn("Windows isn't supported\n") if($^O =~ /win32/i);
impractical.
If a module has extensive platform-dependent codepaths, it is impossible
to achieve full coverage in a single run. One would have to aggregate
the coverage databases from separate D::C runs from, for example, Unix,
VMS and Win32.
This is probably something only the author can do, with perhaps a
willing person who can forward the results from platforms the author
does not have access to. If an author went to such troubles, she would
be deserving of a 48pt bold, orange Kwalitee point.
I know I had my eyes opened by Devel::Cover. I thought I had pretty good
coverage in Regexp::Assemble. In fact I had about 60%. I lifted it up to
100% statement coverage (some branching and conditional paths are never
taken, but they are "normal", for example C<$foo or return 0>). This
toook about 15 hours of work over a week or so. I caught a couple of
minor bugs and one rather big one in the process.
To me, this is a mark of Quality. It would be good to have it as a
Kwalitee metric, but I see no easy way. The simplest way I can see would
be to have a META.yml key that contains a URI to the HTML D::C report. I
would rule out adding a cover/ subdirectory to the distribution due to
the impact it would have on CPAN repositories.
David
--
"It's overkill of course, but you can never have too much overkill."