
Testing is Overrated - nreece
http://www.infoq.com/presentations/francl-testing-overrated
======
richcollins
Testing zealots never seem to understand that some errors are expensive and
some are not. Testing should be a cost benefit analysis.

I never waste my time writing tests when the consequences of errors are cheap.

Conversely, I always write tests when the consequences of errors are
expensive.

~~~
gabriel
I agree that with you that "some errors are expensive and some are not," but
you don't know which category a bug falls under (cheap/expensive) until after
the fact. So making that decision of what (or what not) to test isn't always
so black and white.

~~~
timcederman
It depends on the context. I've had some very simple fixes/updates I've wanted
to put in production that I knew were incredibly low risk, and anything that
could go wrong could not possibly be catastrophic, only to be vetoed and told
to go through a very expensive testing process.

------
blasdel
So many unit tests just rephrase the function you're testing -- all they check
is whether or not you edited the code and test at the same time.

There are some tests that are unassailable -- like checking to see if the
output of a sort function is sorted and whether it has pathological
complexity. On the other hand, duplicating all the conditionals in the code as
tests is bullshit. Mocks are even worse!

~~~
wastedbrains
The reason rephrasing is valuable is that it stop people from taking out or
removing needed cases. If there is a test and someone changes that logic, it
forces them to at least realize someone else tested and wanted that logic.
Then if you search through the code and no something is unnecessary you can
change the logic and the test.

------
igorgue
Please watch the video first, testing is useful, you must write tests, and
perform tests.

But! tests will not increase your quality, they will just keep it.

~~~
tdavis
My dirty little programmer secret is that I've never written a unit test.
Thanks for making me feel bad :(

I watched the video and, indeed, it did not absolve me of my sins.

~~~
maxwell
I never wrote tests until recently, when I started working on a functional JS
library, and realized that if you're not writing them, you're doing them in
your head (which is slower and more error prone). This only applies to
langs/libs/APIs though; for apps, I generally find the UI itself to be the
best test.

~~~
tdavis
Yeah, the last thing I worked on like that was a networking engine and I could
really see where tests would have helped me _a lot_ (all existing code was
covered, but not the new stuff I was writing). Hopefully I will get to work on
that sort of stuff more in the future and can get into the habit of writing
tests in the process.

------
xenophanes
Testing can help find bugs. Testing makes refactoring a lot easier. Testing
protects you against other people breaking your code.

I don't know if testing is overrated, because I haven't carefully measured how
much hype it gets, but I do know testing is useful.

------
wallflower
There was a slim volume called the "The Art of Software Testing" that I
borrowed once from my mentor.

In it, the author posits the following perspective: a successful test is not
one that finds zero errors, a successful test is one that _finds_ errors.

~~~
eru
Zero errors is also OK. As is a proof of correctness.

------
jamesbritt
Are all the Ruby Fringe videos available someplace for downloading (such as
happens with the assorted RubyConf vids)?

------
known
I find the following sequence of testing is productive.

1\. Smoke Testing

2\. Performance Testing

3\. Other tests

------
moe
infoq is overrated.

