[Zope3-dev] Re: The bug fixing problem

Christian Theune ct at gocept.com
Fri Jul 7 07:52:29 EDT 2006


Hi,

Jim Fulton wrote:
> 
> On Jul 6, 2006, at 12:29 PM, Philipp von Weitershausen wrote:
> 
>> dieter at handshake.de wrote:
>>> Christian Theune wrote at 2006-7-5 11:46 +0200:
>>>> ...
>>>> Another thing are the rules about unit tests. Some bugs touch areas 
>>>> that
>>>> are poorly tested. When I fix a bug over there, do I have to work 
>>>> harder
>>>> to introduce the fix because I have to start introducing tests?
>>>> We should find and announce a reasonable answer for the procedure in
>>>> this case.
>>>
>>> Although I have (so far) never fixed a bug in Zope 3 (but posted
>>> several patches for Zope 2), I can confirm this:
>>>
>>>    There are bugs that do not need a test once they are fixed.
>>>    All kinds of "NameError" and "AttributeError" fall into this
>>>    category.
>>>
>>>    Requiring to write a unit test for these or similarly trivial
>>>    bugs is silly -- especially if there is not yet a testing file
>>>    for the module (such that a trivial test would suffice).
>>
>> I disagree. How would you make sure that your fix for even a "trivial"
>> NameError actually works? Perhaps you introduced another typo in the
>> bugfix? Or perhaps another problem pops up in the same codepath.
>> Clearly, since the NameError didn't occur in any other tests, the
>> codepath hasn't been tested yet, so it should be no matter what.
>>
>> There's another aspect to tests for bugs: reproduceability. Especially
>> when fixing bugs I tend to write tests first in order to be absolutely
>> sure that I can reproduce the problem in an automated manner. Then
>> fixing the bug is "easy": Just make the test pass...
> 
> Well said. I agree 100%

Just to make sure nobody got me wrong: I'm not arguing that tests are a 
bad thing. They belong to the best thing that came up in the last years. :)

I was merely pointing to a small edge-case in bugfixing, that might be 
even smaller then anticipated, where I got frustrated in the last time.

+1 for the tests-are-good-recap :)

Christian

-- 
gocept gmbh & co. kg - forsterstraße 29 - 06112 halle/saale - germany
www.gocept.com - ct at gocept.com - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development



More information about the Zope3-dev mailing list