Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Getting real code coverage by instrumenting paths

by diotalevi (Canon)
on Jul 16, 2007 at 06:32 UTC ( #626786=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub foo {
      join ' ',
        ( $_[0] < .5 ? 'a' : 'b' ),
        ( $_[1] < .5 ? 'c' : 'd' ),
        ( $_[2] < .5 ? 'e' : 'f' ),
    }
    
  2. or download this
    use Runops::Trace 'checksum_code_path';
    for ( 1 .. 1000 ) {
      my @args = ( rand(), rand(), rand() );
    ...
    0.47 0.52 0.33 -> b c f
    0.51 0.53 0.63 -> a c e
    0.59 0.53 0.05 -> a c f
    
  3. or download this
    MD5 checksum for codepath       : count
    3486706209c7e59208c012e9fb50a4a8: 65
    44a40eaf7295843c7b98c513acbd30cd: 39
    ...
    ee75b4954053f18a33f00589f2dff817: 28
    8a17266d3f92737fe3154c2ee3acd0b0: 7
    775a10dbb2d9ce52259680e901999d66: 393
    
  4. or download this
    sub codelength {
        my $count = 0;
        Runops::Trace::trace_function(
    ...
        );
        return $count;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://626786]
Approved by Corion
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2014-12-25 23:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (163 votes), past polls