[Zope3-dev] Re: The bug fixing problem
Jim Fulton
jim at zope.com
Fri Jul 7 06:58:22 EDT 2006
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%
Jim
--
Jim Fulton mailto:jim at zope.com Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org
More information about the Zope3-dev
mailing list