Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I was reading Petdances log (use.perl.org) and he summarised testing as .....
    Never underestimate the power of one little test.
    There is no such thing as a dumb test.
    Your tests can often find problems where you're not expecting them.
    Test that everything you say happens actually does happen.
    If it's worth documenting, it's worth testing.

I asked him a few questions on his testing methodology and Andy answered back a few gems that you may find interesting ... (reproduced below).

  1. Think about what the code should do.
  2. Think about the API.
  3. Write the documentation for the code, explaining what the parms do.
  4. Write the test code that uses the API.
  5. Keep doing #3 and #4 until all the cases are covered. "Oooh, I hadn't thought of the case where a length is negative." So you type in the docs "If the length passed is negative, then a warning is thrown," and then write the test that tests that. Or vice versa.
  6. Write the code. You may go back to #3 and #4 as necessary because you think of more things as you write.
  7. Check it into CVS. Move on, knowing that you're covered.

What I get back from this is testing is soft of self discovery processing where testing allows you to enforce how your code should behave. At the same time uncover defects. Follow the links to see what modules are being used.


In reply to Re: Testaholics Anonymous (or how I learned to stop worrying and love Test::More) by g00n
in thread Testaholics Anonymous (or how I learned to stop worrying and love Test::More) by stvn

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 pondering the Monastery: (8)
As of 2024-03-28 10:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found