Philipp von Weitershausen wrote at 2006-7-6 18:29 +0200:
> ... fixing a trivial error without a unit test ...
>How would you make sure that your fix for even a "trivial"
>NameError actually works? Perhaps you introduced another typo in the
Obviously, I have considerable more confidence in my ability to
fix bugs than you do...
>Or perhaps another problem pops up in the same codepath.
Right, that would be possible.
But, at least, one bug was fixed...
>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.
If the test is as trivial as the fix, then one can easily add it
(if one is not confident that the bug is truely fixed).
If not, the about a quarter to half an hour timeframe is
easily exhausted and if you insist on the test, you
get neither the test nor the fix.
>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...
You use the personal form correctly. Not everybody does it like you
When I have introduced secondary bugs in my fixes (which occasionally
happened), then a unit test would not have helped. The reason was then
that the affected code was used in unanticipated ways -- and
because it was unanticipated, I would not have written a test for it.
Zope3-dev mailing list