[TIP] testing: why bother?

Gregory P. Smith greg at krypto.org
Wed Mar 23 22:37:53 PDT 2011

On Wed, Mar 23, 2011 at 7:06 AM, Alfredo Deza <alfredodeza at gmail.com> wrote:

> 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?

What Natalia and Lars have said resonates best with me so far.

Ask the audience this: Who is going to maintain the code you write in the
long term?

Often not you, the original author(s). Certainly not the you in the same
state of mind and knowledge about the details of the code base that you have
at the moment you originally wrote it. Write tests so that you don't have to
keep all of that in your mind and so that other people can become productive
quickly in that code base.

Want more? pose this question: Have you ever jumped into a project written
by others and needed to make changes without time to understand the entire
system yourself?

This is quite common in large projects and code bases. Without easy to run
tests doing such changes even if they are supposed to be simple refactorings
that change no logic is a big effort.

Tests are a form of API contract, they both verify and document a set of
specific behaviors.


> You can reply with multiple ones, but I am interested in the one you think
> is *the* mot important one.
> One thing to consider though is to think about the problem from their
> perspective: "Why do I need to write tests?"
> I want to make a dent in that crippled thinking!
> I also posted the question in Convore but not everybody is in there, plus I
> know that I get the best quality
> testing-related answers here :)
> Any feedback is *greatly* appreciated!
> -Alfredo
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20110323/545191ff/attachment.htm>

More information about the testing-in-python mailing list