On Jul 7, 2006, at 7:52 AM, Christian Theune wrote:

Hi,

Jim Fulton wrote:
On Jul 6, 2006, at 12:29 PM, Philipp von Weitershausen wrote:
[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
   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 :)

And just to make sure that I was clear, when trying to urgently go through
bugs for a release, I think it's OK to provide a test for just the fix.

If, in the course of a fix, you notice that a package is short of tests,
it would be great to add more then, but it would be OK to just turn that
lack of tests into a separate non-urgent bug entry.

Jim

--
Jim Fulton                      mailto:[EMAIL PROTECTED]                Python 
Powered!
CTO                             (540) 361-1714                  
http://www.python.org
Zope Corporation        http://www.zope.com             http://www.zope.org



_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to