Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Perl Skills

by moritz (Cardinal)
on Jun 15, 2010 at 11:56 UTC ( [id://844845]=note: print w/replies, xml ) Need Help??


in reply to Re: Perl Skills
in thread Perl Skills

100% coverage isn't always achievable.

For example I put Carp::confess statements in some of my modules to catch internal errors. When my module works fine, there is simply no way to trigger them. They are dead code.

Still they are very useful, because when I change something and break the module, I get much better error messages than without those statements.

One could try to trigger thee cases by monkey-patching the module to misbehave, but I think that's a rather foolish idea.

Replies are listed 'Best First'.
Re^3: Perl Skills
by Ratazong (Monsignor) on Jun 15, 2010 at 15:45 UTC

    Our way to reach 100% coverage is the following:

    1. we do module-test to cover as near as 100% as possible
    2. if we reach less than 100% (this is the normal case), we analyze/review all parts that were not covered by the test
      • if we discover testing-gaps, we enhance the module test
      • if some code is really not testable, but OK according the analysis/review, we consider it covered
    With that proceeding it is always possible to reach the 100% coverage. And I don't think it is cheating ;-)

    HTH, Rata

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-18 05:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found