I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2005-10-31 12:23:15-08 by stf
Filtering subroutine stats

I've started using Devel::Cover (excellent module!) to analyze my test suite. One thing I'm finding is that in the subroutine coverage analysis in most of my modules BEGIN gets included several times. I have some modules reporting 50% coverage testing when in actuality none of the functions are being run. It's just hitting BEGIN 3 times, none of the 3 functions, and reporting 50%. While I'm sure this is technically accurate, it's inflating my numbers and making the tests look better than they should. (I'm trying to make the case that we need to do more testing, so I don't want this. :-)

Two questions:

1. Why is BEGIN appearing numerous times? Because I'm using the module in several different places? Is there something with my code that I can do to mitigate having it show up so many times in the coverage analysis?

2. Is there any workaround I can use to filter BEGIN out entirely while I work on testing the remaining code? I have very few BEGIN blocks of interest and while I'd probably restore them to the list later, I don't want them there now.

Thanks for the module and any help you can provide.

Steve

Direct Responses: 1272 | Write a response