does lack of type declarations make Python unsafe?

Ben Finney bignose-hates-spam at and-zip-does-too.com.au
Mon Jun 16 20:15:14 EDT 2003


On Mon, 16 Jun 2003 12:11:05 -0400, Peter Hansen wrote:
> Tim Rowe wrote:
>> "The choice between compile time testing and run-time testing is the
>> choice between the programmer finding the bugs and the customer
>> finding the bugs".
> 
> Only if you don't bother to run the software before you give it
> to the customer.

You, the programmer (or team of programmers) will never run the program
the same way as the customer will, except by blind accident.  You can't
know what the customer will do with it ahead of time, and neither can
the customer.

Moreover, unless your program is used by a number of people as small as
the development team, you will never run the program in as many ways, or
over as much time, as the customer will.

Testing cannot try more than a miniscule fraction of the combination of
inputs and usage that the customers will subject it to.  Automated
testing, carefully thought out, can increase this fraction
significantly; but "run the software before you give it to the customer"
is a laughably inferior way of finding bugs.

> That's what unit and acceptance tests are for... they substitute for
> the customer, and catch more bugs than you would in either case if you
> relied only on compile-time testing, or only on customer-time testing.

Exactly; use of *only* compile-time testing, or *only* run-time testing,
are both inadequate, and are not mutually exclusive.  So use both.

That's what the security guys call "defense in depth".

-- 
 \     "If you're a horse, and someone gets on you, and falls off, and |
  `\      then gets right back on you, I think you should buck him off |
_o__)                                     right away."  -- Jack Handey |
http://bignose.squidly.org/ 9CFE12B0 791A4267 887F520C B7AC2E51 BD41714B




More information about the Python-list mailing list