Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: How does one avoid tautologies in testing?

by gwadej (Chaplain)
on Jul 15, 2009 at 16:48 UTC ( #780397=note: print w/replies, xml ) Need Help??

in reply to How does one avoid tautologies in testing?

It's important to keep in mind that unit testing often serves multiple purposes. Partially, the tests serve to understand and validate the code. They also help document usage. They (hopefully) also get used for regression testing. I find tautological tests (let's call them Ttests) are most useful in this final case.

moritz hits the nail on the head with the comments about the Perl 6 testing. The purpose of these simple Ttests is to make sure something fundamental has not changed. If (after your tests have been in use for a while) one of these Ttests fails, you know immediately that something fundamental in the system has been broken.

For example, will this test save you someday when someone decides that some caching or lazy-loading solution can be added because it could not possibly break anything.

Some of the longest debugging sessions I've ever been part of were finally resolved when we tested something that could not possibly be wrong and it was. Every time I put in a Ttest, I think about these sessions. Every now and then, I catch a bug this way.

G. Wade
  • Comment on Re: How does one avoid tautologies in testing?

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2016-10-28 11:29 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (381 votes). Check out past polls.