Python from Wise Guy's Viewpoint

Pascal Costanza costanza at web.de
Tue Oct 28 17:16:36 EST 2003


Stephen J. Bevan wrote:

> Pascal Costanza <costanza at web.de> writes:
> 
>>Fergus Henderson wrote:
>>
>>
>>>>Dynamic typing works better with XP than static typing because with
>>>>dynamic typing you can write unit tests without having the need to
>>>>immediately write appropriate target code.
>>>
>>>That one seems to have been pretty thoroughly debunked by other
>>>responses
>>>in this thread.  A static type system won't stop you writing unit tests.
>>>And if you want to actually run the unit tests, then you are going to
>>>need appropriate target code, regardless of whether the system is
>>>statically or dynamically typed.
>>
>>Not if I only want to check whether the first ten tests work, and
>>don't care about the remaining ones.
> 
> 
> Perhaps I'm just a low tech kind of guy but if I just want to run the
> first ten then I comment out the rest.  Even without a fancy IDE that
> only take a few key presses.

...and it requires you to go to all the places where they are defined.

Yes, I know the answer: "But they should be all in one place." No, they 
shouldn't need to be all in one place. For example, I might want to 
place test code close to the definitions that they test. Or I might want 
to organize them according to some other criteria.

No, it's not hard to find them all, then. I can use grep or my IDE to 
find them. But that's still more work than just commenting them out. If 
I seldomly need to find all test cases, I can trade locality of all test 
cases for some other possible advantages.

Ah, another example: What if my test code is actually produced by some 
macro, or some other code generation facility?


Pascal





More information about the Python-list mailing list