Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

There is too much variability in the premise of the question. If I'm doing a short, one off script, or something that's similar to things I've done before (or uses concepts that I've used dozens of times before), I'm probably not going to do any testing.

If it's something that's going to run for years, but I'll have tight control of, and there aren't any major repercussions if it fails, I'll do some basic testing, but it's not going to be exhaustive.

If it's going to be released into the wild, or I'm doing it under a contract, and I'll have no control over how it gets used, I'm going to do my damned to make sure that every possible permutation gets tested.

I find that it's a lot like optimizing code -- you have to weigh the overall risk of something failing ( the change of it happening, the overall impact, etc ), and the amount of time the tests are going to take. If writing tests are going to take 4x longer than the amount of time to write the initial code, you're not always going to do it. (like what I was working on last week ... but because of the end product, I need it bulletproof, so I wrote the tests) If I was on a tight deadline, I might not have done such exhaustive testing. (much of the time writing my tests was in determining that the logic in my test scripts were flawed, not the actual program itself).

In find that a few things help, such as using a text editor that's language aware ( the one I use handles syntax coloring, string coloring, and matching ({[]}) characters, which can give me a few clues before things have gotten too far out of line. Even the occassional perl -wc can be enough to make sure you haven't completely screwed up. For the most part, I try to get things working whenever I reach a good stopping point for the day -- sometimes, there isn't a good point for the day. If my brain feels fried in the afternoon, I'll sometimes leave stuff 'till the next morning, or even over the weekend...it just depends on the situation.

I think there is no one good answer for this -- yes, more experience helps, but you have to evaluate what it is that you're trying to do, and what the correct level of testing is for that particular program/module/function/whatever. If I'm on a roll programming, I'll keep on writing for quite some time (maybe days), without any debugging. Of course, if I'm massively stuck, I might go for days without any debugging, too.


In reply to Re: Programming strategy with no on-going testing by jhourcle
in thread Programming strategy with no on-going testing by punkish

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 browsing the Monastery: (8)
As of 2024-04-19 07:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found