"Strong typing vs. strong testing"

Nick Keighley nick_keighley_nospam at hotmail.com
Sat Oct 2 11:34:42 CEST 2010


On 1 Oct, 11:02, p... at informatimago.com (Pascal J. Bourguignon) wrote:
> Seebs <usenet-nos... at seebs.net> writes:
> > On 2010-09-30, Ian Collins <ian-n... at hotmail.com> wrote:


> >> Which is why agile practices such as TDD have an edge.  If it compiles
> >> *and* passes all its tests, it must be right.
>
> > So far as I know, that actually just means that the test suite is
> > insufficient.  :)
>
> > Based on my experience thus far, anyway, I am pretty sure it's essentially
> > not what happens that the tests and code are both correct, and it is usually
> > the case either that the tests fail or that there are not enough tests.
>
> It also shows that for languages such as C, you cannot limit the unit tests
> to the types declared for the function, but that you should try all the
> possible values of the language.

I'm not sure what you mean by "all the possible values of the
language". But some meanings of that statement are plainly wrong! For
instance you don't test every possible pair of ints in a max()
function (maybe 2^64 distinct tests!)

> Which basically, is the same as with dynamically typed programming
> language, only now, some unit tests will fail early, when trying to
> compile them while others will give wrong results later.

<snip>



More information about the Python-list mailing list