[Tutor] Using unittest module for Test Driven Development

Alex Kleider akleider at sonic.net
Mon Aug 25 11:45:33 CEST 2014


On 2014-08-25 01:10, Marc Tompkins wrote:
> On Mon, Aug 25, 2014 at 12:04 AM, Alex Kleider <akleider at sonic.net> 
> wrote:
> 
>> I appreciate your further elucidation, like your 'sledge hammer' 
>> metaphor and thank you for the fragility warning. I expect within such 
>> a limited scope, the dangers are not great.
> 
> As someone who has been burned by this sort of thinking, please allow
> me to urge you:  get into good habits now!  At various points in my
> career when I've been learning a new language/technology/paradigm,
> I've decided to take shortcuts when writing my early "toy" programs.
> Unfortunately, in several cases, my "toy" programs ended up evolving
> into production code - shortcuts and all.  In particular, I used to
> assume that my code - since it was either a learning exercise or a
> utility for myself alone - would only ever run in a
> single-user/single-tasking environment, and that when I wrote the
> "real" program later (in my copious free time) I would take the
> necessary precautions.  Please, take a fool's advice: always assume
> that any program you write (more complex than "Hello world") will
> eventually be running in a busy environment, or that your user will
> manage to invoke five copies of it instead of one, or...

Thanks for the sage advice; so much to learn.
Since this is in a unittest module, it's unlikely that it'll get out
into the sort of situation you describe, n'est pas?


More information about the Tutor mailing list