Data-driven testing

Alex Martelli aleax at aleax.it
Thu Apr 24 17:14:24 EDT 2003


Peter Hansen wrote:
   ...
> I could have said that, but I know Aahz knows when something is really
> throwaway, and there are such things, so I thought I'd try answering

Well, then Aahz is wiser and more perceptive than me, because _I_
don't know -- I've noticed that often what I *believed* I would throw
away, I end up reusing instead.  SOME things i eventually do throw
away (or lose track of...:-), but I can't predict which ones in advance.

> the question directly for a change.  ;-)  And I did emphasize that this
> was for _literally_ throwaway scripts, which do exist.  If nothing else,
> you could call it a spike solution which is expected to be used, once
> only, then tossed.  If it turns out it's got to be used again, then it
> should be re-written anyway so it's not a serious problem that it lacks
> tests.

Why "should" something be rewritten rather than tweaked if it already
does 90% of what you now need?  Pah.  Of COURSE I'm just gonna tweak
it, because I'm in a hurry (I always am) and that will save me lots of
time.  So -- it IS a problem that it lacks tests.

> throwaway than the ones I "know" are not.  If I'm wrong... no big deal:
> I rewrite as a real script with proper tests.  Since the script was
> only twenty or thirty lines of code (any more and it could not possibly
> be throwaway, right?) it isn't really a big deal.

Wrong.  "Throwaway" means "I [think I] am going to need to run this
only once".  Whether it's 30 or 60 lines has nothing to do with it.


Alex






More information about the Python-list mailing list