Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Much as I typically disagree with dragonchild, I'll agree with him on this point.

Your caller should know what the impact of calling your function is. If it has side effects or dependencies (such as requiring sockets to be available, stomping on global variables, requiring filesystems to be writeable, or so forth), those restrictions should be published as as part of the function interface, so that they can be tested, by someone other than the author of the code.

If a tester can get an undocumented side effect from calling a given function, that's a bug in the code, or the code documentation. Either is bad.

How much this matters depends on what you're dealing with, and what failure modes you can handle. If, for example, you're sure your production server can't possibly run out of filehandles, because it will crash due to other limitations long before that becomes an issue, perhaps there's no real viable way to test, let alone recover from the "out of filehandles" condition. If you document your position, it's at least a calculated risk, not just an accidental assumption, and if it proves to be false, you at least have a explanation for why the choice to ignore it was made. And if/when you upgrade your server, you'll catch the limitation of the software when you read through the limitations list for all your server code prior to the upgrade.
--
AC


In reply to Re^7: Neither system testing nor user acceptance testing is the repeat of unit testing (OT) by Anonymous Monk
in thread Neither system testing nor user acceptance testing is the repeat of unit testing (OT) by pg

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
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-04-24 02:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found