Perl::Critic test coverage

ChrisDolan on 2006-08-17T15:46:34

I'm one of the seven core developers for the Perl::Critic package.

I spent a bunch of time this week rounding out the test coverage. When I started Monday, we were already over 90% coverage, according to Devel::Cover. Now we're over 95% with a couple fewer bugs than before. I'm happy to say that MOST of our 80 policy modules now have 100% test coverage. While coverage does not map directly to software quality, of course, it's one of the best metrics available so I'm pretty proud of our accomplishments.

We're working toward a 1.0 release sometime early this fall.


Thanks!

sigzero on 2006-08-17T17:44:02

I use P::C all the time.

Re:Thanks!

ChrisDolan on 2006-08-18T01:53:19

Great! Have any features you'd like added? Any additional policies you'd like to see enforced?

Our TODO.pod is big already, but I'd love to add more good ideas to it.

Re:Thanks!

jk2addict on 2006-08-18T11:42:12

I have a minor nit/suggestion. In the pod/docs for each policy, it would be nice if it mentioned the default severity level for each policy module.

I found myself viewing source on every module trying to fine out which severity level it applied to.

In the end, I ended up setting my test file to severity = 1, and then making a policy for each dist that customized or disabled the policies that didn't jive w/ the dist. Kind of a All On By Default thing. Then when new policies come out, I'll automaticaly catch them, and either accept them or adjust accordingly.

Re:Thanks!

ChrisDolan on 2006-08-18T15:39:36

I recommend "bin/perlcritic -list" which lists all of the policies by package name and severity.

On the developer mail list, we're discussing transforming the severity system into a more generic tagging system. My hope is that we'll implement that for v1.0 within the next month.

Re:Thanks!

jk2addict on 2006-08-18T15:25:28

Also, I think Variables::ProhibitPunctuationVars should be tweakable imho.

I agree with most of it, but I'd like ti be able to tell it to except $@ as well.

Re:Thanks!

ChrisDolan on 2006-08-18T16:02:16

Your wish is my command. :-)

I just committed a patch to SVN that implements the following example:

    [Variables::ProhibitPunctuationVars]
    allow = $@ $!

This feature will be present in the forthcoming v0.19.

Re:Thanks!

jk2addict on 2006-08-18T16:41:14

Heh. You rock. Thanks. :-)

Bah!

jk2addict on 2006-08-17T19:57:51

I curse you and your Perl:Critic post!

I was coding along, getting things done, then I had to read this post and install [Test::]Perl::Critic and make a test script for my dists. Holy distraction batman. :-)

Re:Bah!

ChrisDolan on 2006-08-18T01:51:47

:-)

Speaking of distraction, I direct the free-time-laden reader to check out a humorous SVN commit message I wrote while working on Perl::Critic.