[EMAIL PROTECTED] 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
> 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...
Zope3-dev mailing list