declaration of variables?

Christian Tismer tismer at tismer.com
Mon Feb 24 23:18:16 EST 2003


jcm wrote:
> Christian Tismer <tismer at tismer.com> wrote:
> 
>>jcm wrote:
>>...
> 
> 
>>>And these unit tests are likely written in Python, and have the same
>>>quirks as the programs they're testing.
> 
> 
>>You sound like you've never written a unit test in your life,
>>otherwise you would not move yourself in such a questionable
>>corner.
>>Unit tests are so much easier to test than your application,
>>and proving a program to be wrong is so much easier than
>>to prove it being right!
> 
> 
> I've written quite a few (and I don't feel like I'm in any corner).
> I'm just pointing out that unit tests are themselves programs.

Obviously, they are.
But they are by an order of magnitude less error-prone.
Unless you aren't whole-heartedly playing against yourself
(and it *is* good advice to have someone else playing this role),
every bug in your testing code makes you investigate in your
testing code *and* your implementation.
To my experience, the testing code quickly gets more elaborated
than what you are testing, and this is very good so.

>>>Certainly tests are extremely useful, although if you're script is
>>>small/simple enough, I think it's reasonable to go without.

I have been arguing this way, too, until I was forced to
prove myself by doing exhaustive testing of my code.
And guess what: I liked it very very much, having such
a positive feedback, when you can claim that you applied
some very deep testing, and the code is able to stand it.
And believe me, I found about four serious bugs in a code
where I was absolutely confident that it was too simple
to have any obvious bugs. Learning this after 25 years
of coding experience was quite an enlightment.

...

> I don't think we disagree.

I'm not completely assured, yet :-)

Gice me some code, and be surprized which kind of tests
I will pour it through.

cheers - chris

-- 
Christian Tismer             :^)   <mailto:tismer at tismer.com>
Mission Impossible 5oftware  :     Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9a     :    *Starship* http://starship.python.net/
14109 Berlin                 :     PGP key -> http://wwwkeys.pgp.net/
work +49 30 89 09 53 34  home +49 30 802 86 56  pager +49 173 24 18 776
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
      whom do you want to sponsor today?   http://www.stackless.com/







More information about the Python-list mailing list