Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

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
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 drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2014-09-23 19:42 GMT
Find Nodes?
    Voting Booth?

    How do you remember the number of days in each month?

    Results (240 votes), past polls