Devel::Cover recommendations... or maybe not?

Paul Johnson paul at pjcj.net
Wed Mar 14 23:43:36 GMT 2007


On Wed, Mar 14, 2007 at 06:51:00PM +0000, Dirk Koopman wrote:
> Richard Jolly wrote:
> > 
> >  http://pjcj.sytes.net/cpancover/
> 
> Is it just me, or should more people be concerned that the Test::* 
> coverage is rather less than 100%?

It's funny stuff, that code coverage, what with it basically being
statistics and all.

Here are some reasons why perfectly good code might not have 100%
coverage from my cpancover output:

 - My specific combination of hardware, operating system, configuration,
   installed software or some other variable, doesn't allow some of the
   code to be exercised.

 - Some configuration might be needed to run all the tests.

 - The author performed a manual test, or in some other way convinced
   themselves that the code was good, and considered their precious time
   might be better used somewhere else.

 - Devel::Cover might have bugs.

 - Oh yes, it just might.

Or there might be bugs lurking in the uncovered code.

In any case, the coverage of the Test:* modules isn't that bad.  In
fact, it seems pretty good in general.  And CPAN coverage in general is
much better than it was many moons ago.

In the case of the Test module which looks the worst,
Test::WWW::Selenium, the reason for the low coverage, if I recall
correctly, is that part of the module is automatically generated from
some XML which also generates code for Java, Python, C# and Ruby (that
list is probably wrong), and the Perl module doesn't need most of the
generated functions, so they aren't tested.

So there's another reason to add to the list.

So the answer to your question, I suppose, is that although I don't know
how many people are actively concerned about the state of Test::* code
coverage, a few more probably wouldn't hurt.  Although I suspect that
most people could probably find something they considered more important
to be concerned about.

-- 
Paul Johnson - paul at pjcj.net
http://www.pjcj.net


More information about the london.pm mailing list