CPAN Purity Test [c/o Planet Debian]

n1vux on 2006-03-14T16:48:23

One of the Debian Developers, Joey Hess, blogged about his Perl script to "Test how much of a the guts of a program comes from sweet, delicious CPAN, and how much is nasty perl code you wrote."

via

I'm not sure that's a really useful reuse metric, but it's sure amusing.


Disappointing useless

brian_d_foy on 2006-03-15T16:10:21

I was curious to see what he did about that, and discovered he wrote quite a bit of code that really doesn't do anything. He loads a program then traverses %INC. He skips certain entries, and everything else must be from CPAN ignoring core modules, and anything else he neglected not to skip. He then sums all the lines (and CPAN modules are more likely to have a lot of POD) from the files and adds those to either the CPAN or the local count.

That's pretty useless outside of writing Perl code to kill time.

Re:Disappointing useless

n1vux on 2006-03-16T15:54:02

That's pretty useless outside of writing Perl code to kill time.

Agreed, totalling interesting looking things included versus size of script is a strange number. Meaningless.

As always, we should say "Compared to what?".

A more plausibly useful metric of reuse would use static or dyanmic analysis to determine how many lines/functions/feature-points of the use'd modules were actually used., compared to same for the script. I'm not sure even that is going to be useful to anyone but PHB's, but at least it's less absurd.

I just thought it was amusing.