Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re^2: Philosophical question about testing

by doom (Deacon)
on Oct 29, 2010 at 17:31 UTC ( #868366=note: print w/replies, xml ) Need Help??

in reply to Re: Philosophical question about testing
in thread Philosophical question about testing

You have good instincts. You should strive for an orthogonal approach,
This is true, of course, you should try to think of a way to independently verify what the code does, but I would suggest there isn't any reason to go beserk about it.

Consider the fact that the algorithm in both code and test may be the same to start with, but they may diverge later. You might go in and refactor the main code, for efficiency, let's say, and then the older style of code out in the tests will be an excellent check on your work.

In general, tests should be relatively easy to write, or else you (or worse, your boss) will burn-out on it, and start skipping them altogether. A lot of things that would be Bad And Wrong in your real code are okay in your tests... e.g. cut-and-paste is a much more valid approach.

  • Comment on Re^2: Philosophical question about testing

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2023-10-04 20:29 GMT
Find Nodes?
    Voting Booth?

    No recent polls found