Project organization and import

Jorge Godoy jgodoy at gmail.com
Tue Mar 6 06:53:58 EST 2007


aleax at mac.com (Alex Martelli) writes:

> Bruno Desthuilliers <bdesth.quelquechose at free.quelquepart.fr> wrote:
>
>> >>I don't reload...  When my investigative tests gets bigger I write a script
>> >>and run it with the interpreter.  It is easy since my text editor can call
>> >>Python on a buffer (I use Emacs).
>> >  
>> > That's interesting, is this workflow pretty universal in the Python
>> > world?
>> 
>> I don't know, but that's also mostly how I do work.
>
> My favorite way of working: add a test (or a limited set of tests) for
> the new or changed feature, run it, check that it fails, change the
> code, rerun the test, check that the test now runs, rerun all tests to
> see that nothing broke, add and run more tests to make sure the new code
> is excellently covered, rinse, repeat.  Occasionally, to ensure the code
> stays clean, stop to refactor, rerunning tests as I go.

I believe this is a distinct case.  When we write tests we're worried with the
system itself.  When using the interactive interpreter we're worried with how
to best use the language.  There might be some feature of the system related
to that investigation, but there might be not.  For example: "what are the
methods provided by this object?" or "which approach is faster for this loop?"

I won't write a test case to test loop speed.  But I'd poke with the
interpreter and if the environment gets a bit big to setup then I'd go to the
text editor as I said. 


-- 
Jorge Godoy      <jgodoy at gmail.com>



More information about the Python-list mailing list