Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #29003

Re: avoid the redefinition of a function

Date 2012-09-12 17:45 -0500
From Tim Chase <python.list@tim.thechases.com>
Subject Re: avoid the redefinition of a function
References <CAOuJsMnLf4P9p_rZ4p1W-SndkSOV2WK_v5j1AET085LZ6bdavQ@mail.gmail.com> <k2qrqb$12n$1@ger.gmane.org> <20120912174713.64537455090c4058120d9409@druid.net>
Newsgroups comp.lang.python
Message-ID <mailman.583.1347489884.27098.python-list@python.org> (permalink)

Show all headers | View raw


On 09/12/12 16:47, D'Arcy Cain wrote:
> On Wed, 12 Sep 2012 16:37:11 -0400
> Terry Reedy <tjreedy@udel.edu> wrote:
>> assures one that the test is being run. (I don't always test first, but 
>> I once discovered a test not being run when I modified it in a way that 
>> should have made it fail, but it didn't.)
> 
> 1. Write the test
> 2. Run the test - make sure it fails
> 3. write code until test passes
> 4. Stop writing code
> 
> People underestimate the importance of steps 2 and 4.  Number 2 is
> important because a test that can't fail is worse than useless.  Number
> 4 is important because it prevents code that doesn't have a
> corresponding test.  If you feel the need to write more code then go
> back to step 1.
> 
> And run all of your tests every day.  You will sleep better at night.

Though I usually try to do test-driven development, I confess a
fondness for Titus Brown's "Stupidity driven testing"[1] :-)

-tkc

[1]
http://ivory.idyll.org/blog/stupidity-driven-testing.html
(one of my most memorable pearls from PyCon'07)


Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: avoid the redefinition of a function Tim Chase <python.list@tim.thechases.com> - 2012-09-12 17:45 -0500

csiph-web