Data-driven testing

Timothy Grant tjg at craigelachie.org
Wed Apr 23 19:42:59 CEST 2003


On Wednesday 23 April 2003 09:16 am, Aahz wrote:
>
> Which brings up the question: do the unit-testers here write tests for
> throwaway scripts?

Absolutely! Well, mostly if I'm going to be writing a throw-away that will be 
manipulating important data. I wrote some code to reformat all the phone 
numbers in a *very* large database, that contained phone numbers and other 
things in the phone number field, and the phone number formats were all 
different, etc.

I made a list of every exception I could find, and wrote tests that each one 
of those conditions was correctly handled, and that the script bailed if it 
came across a condition it couldn't handle.

By the time I ran that thing against our live database, I was extraordinarily 
confident that it would work flawlessly.

-- 
Stand Fast,
    tjg.

Timothy Grant
www.craigelachie.org






More information about the Python-list mailing list