Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Test/ Code Ratio

by adamk (Chaplain)
on Jan 28, 2005 at 08:48 UTC ( [id://425879]=note: print w/replies, xml ) Need Help??


in reply to Test/ Code Ratio

Ignoring the coverage stats and just looking at pure size, what you might be interested to do is to take PPI, load each file from the code and tests and find the number of significant tokens in each.

That would give you some idea of size in non-line terms.

I've been thinking about writing something like this for a while.

Replies are listed 'Best First'.
Re^2: Test/ Code Ratio
by tphyahoo (Vicar) on Jan 28, 2005 at 09:01 UTC
    What's PPI?
      Eep, sorry.

      PPI is (originally) short for Parse::Perl::Isolated. It parses perl as a Document, without using perl itself.

      The "Signficicant Tokens" metric ignores lines, variable name lengths, string length, POD and just goes on the complexity of the code itself, and can be found using something like the following.

      use PPI; # Load a perl document my $Document = PPI::Document->load( 'mycode.pl' ); my $significant = grep { ! $_->significant } $Document->tokens;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://425879]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-03-29 08:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found