[TIP] testing: why bother?

C. Titus Brown ctb at msu.edu
Wed Mar 23 07:09:55 PDT 2011


On Wed, Mar 23, 2011 at 02:04:34PM +0000, Michael Foord wrote:
> On 23/03/2011 13:06, Alfredo Deza wrote:
>> Hi list,
>>
>> I am about to give a presentation about testing in a couple of days  
>> and the audience is in its majority a
>> "we do not write tests" one :(
>>
>> If you had to name the single most important reason why you need to  
>> write tests (or keep up with them) what
>> would that reason be?
>>
>> You can reply with multiple ones, but I am interested in the one you  
>> think is *the* mot important one.
>>
>> One thing to consider though is to think about the problem from their  
>> perspective: "Why do I need to write tests?"
>> I want to make a dent in that crippled thinking!
>>
>> I also posted the question in Convore but not everybody is in there,  
>> plus I know that I get the best quality
>> testing-related answers here :)
>>
>> Any feedback is *greatly* appreciated!
>
> I'm with Jonathan that TDD is the best way to test. For me TDD is far  
> more about a design process, and thinking about code, than it is about  
> ending up with tests. That's a *very* nice side-effect though.
>
> The main reason having tests is nice is for when you have to *change  
> something*. Making changes to code and then not knowing whether you've  
> broken anything is a horrible experience. Attempting a big refactoring  
> with no way of really knowing when you're done (when all your tests pass  
> again) - or even *what* you've done - is a scary thing. Having a good  
> test suite doesn't make refactoring painless, but boy not for anything  
> would I go back to the days of refactoring without tests....

(Since I like to argue with Michael...)

IMO, TDD is too big a leap for people without a fair amount of
programming experience.  However, once you have a bit of testing
under your belt, TDD becomes much easier to justify.

--titus
-- 
C. Titus Brown, ctb at msu.edu



More information about the testing-in-python mailing list