Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Testaholics Anonymous (or how I learned to stop worrying and love Test::More)

by g00n (Hermit)
on Apr 03, 2004 at 04:43 UTC ( #342233=note: print w/ replies, xml ) Need Help??


in reply to Testaholics Anonymous (or how I learned to stop worrying and love Test::More)

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.


Comment on Re: Testaholics Anonymous (or how I learned to stop worrying and love Test::More)
Re: Re: Testaholics Anonymous (or how I learned to stop worrying and love Test::More)
by petdance (Parson) on Apr 04, 2004 at 03:58 UTC
    Some time I need to combine all this stuff into http://qa.perl.org/ so it's all in one place...

    xoxo,
    Andy

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2014-12-20 01:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (95 votes), past polls