Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2018-06-22 04:40 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (121 votes). Check out past polls.