Test cases and static typing

Pascal Costanza costanza at web.de
Fri Oct 24 16:59:43 EDT 2003


ketil+news at ii.uib.no wrote:
> Pascal Costanza <costanza at web.de> writes:
> 
> 
>>Dirk Thierbach wrote:
> 
> 
>>>>testxyz obj = (concretemethod obj == 42)
> 
> 
>>>Does the code compile as long as concretemethod doesn't exist?
>>>No. Does your test pass as long as conretemthod doesn't exist? It
>>>doesn't, for the same reason.
> 
> 
>>As long as I am writing only tests, I don't care. When I am in the
>>mood of writing tests, I want to write as many tests as possible,
>>without having to think about whether my code is acceptable for the
>>static type checker or not.
> 
> 
> Uh...the type system will let you *write* what you want, it will just
> stop you from *running* those tests.  Which are obviously going to
> fail anyway.  Okay, so perhaps you for some reason needs to write the
> tests for nonexistent code, and then run something else that you keep
> in the same file.  

+ not "for some reason". Writing tests for nonexistent code is in fact 
one of the key ideas of extreme programming.

+ No, I don't want to run code that happens to be in the same file. My 
development environment can already do some very useful things with the 
test code even if it isn't statically type-checkable yet.


Pascal

-- 
Pascal Costanza               University of Bonn
mailto:costanza at web.de        Institute of Computer Science III
http://www.pascalcostanza.de  Römerstr. 164, D-53117 Bonn (Germany)





More information about the Python-list mailing list