[TIP] testing: why bother?

Mark Sienkiewicz sienkiew at stsci.edu
Wed Mar 23 11:11:23 PDT 2011

Alfredo Deza wrote:
> Hi list,
> I am about to give a presentation about testing in a couple of days 
> and the audience is in its majority a 
> "we do not write tests" one :(
> If you had to name the single most important reason why you need to 
> write tests (or keep up with them) what
> would that reason be?

You don't need a logical reason for those people.  If logic could 
convince them, I think they would have figured out the merits of testing 
by now.  Try an emotional reason:

Do you CARE if your software works?

... wait for people to say "yes"

Good, because it would make you look bad if you admitted that you don't 
care about doing a good job.  (Some programmers don't care, you know.)

So, Do you KNOW if your software works? 

How do you know?

Did you try it before you gave it to the user?  Why would you do that?

... wait for them to say something like "to make sure it works"

That was a test -- you just did it by hand.  Can you do the same test again?

... they can't, unless they are working from a written procedure.  "Play 
with the user interface" is not reproducible because you might do 
different things every time.  If they have a test procedure that shows 
what to do in what order and how to recognize success/fail, then they 
_have_ written a test.

Maybe "play with it for an hour" is good enough for you.  You can do 
that if it is acceptable for the software to have bugs because you don't 
want to put that more effort into checking for them.  But when the user 
says "It is broken!", you have to be comfortable admitting that you 
COULD have tested it more but you CHOSE not to.

What if you want to do better?

... talk about various testing techniques here ...

What I'm trying to do with this outline is lead them into thinking for 
themselves "Yes, I want that".  Make them think "How can I get that?" 
instead of "How can I show that everything this speaker is saying is wrong?"

Mark S.

p.s.  Of course, you have to accept that there are real-world reasons to 
skimp on testing.  That is an engineering tradeoff -- something else is 
more important that reliability.  Maybe just having a new feature is 
more important than whether it works every time.  Maybe the users don't 
mind doing your testing for you, so it doesn't make economic sense to 
spend much time testing.  Maybe you're planning to ship the software, 
drain the company bank account, and leave the country before anybody has 
time to complain about the quality.

If your audience is convinced that a similar case applies, you have no 
hope of persuading them because they already know that testing is not 
cost effective.

More information about the testing-in-python mailing list