Mailing List Archive

Checkins for 2.7 and 2.8 and missing unit tests
Hi coders,

I must say I'm disappointed with a number of checkins that happened in
the past month for the 2.7 and trunk of Zope 2: many are missing unit tests.

While I understand the need to "fix bugs", I can't see the point of
doing this without adding unit tests that exercise the problem, and
document the why and how of things. Just because a patch sits in the
collector and "works" is no reason to apply it without writing a test,
especially for subtle features such as quoting and escaping.

Here's a sample of things for which I believe unit tests are important:

http://mail.zope.org/pipermail/zope-checkins/2004-November/028556.html
no test of webdav escaping
http://mail.zope.org/pipermail/zope-checkins/2004-November/028562.html
no test (escaping, cdata)
http://mail.zope.org/pipermail/zope-checkins/2004-November/028654.html
no test (local roles)
http://mail.zope.org/pipermail/zope-checkins/2004-December/028737.html
no test (clone in webdav)
http://mail.zope.org/pipermail/zope-checkins/2004-December/028750.html
no test of ACTUAL_URL and URL quoting

I would like to urge all committers to always write unit tests for every
change they make.

Florent

--
Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D
+33 1 40 33 71 59 http://nuxeo.com fg@nuxeo.com
_______________________________________________
Zope-Coders mailing list
Zope-Coders@zope.org
http://mail.zope.org/mailman/listinfo/zope-coders
Re: Checkins for 2.7 and 2.8 and missing unit tests [ In reply to ]
On Fri, Dec 03, 2004 at 04:13:55PM +0100, Florent Guillaume wrote:
| I would like to urge all committers to always write unit tests for every
| change they make.

Well, I actually have tests for most of my checkins, however I'm
waiting for Stephan Holek to update the ZopeTestCase included in Zope
to the latest version, which includes functional doctests. The reason
for that is that I am become a a functional doctest addict *wink*

If you want to see the tests, google for DavPack.

--
Sidnei da Silva <sidnei@awkly.org>
http://awkly.org - dreamcatching :: making your dreams come true
http://www.enfoldsystems.com
http://plone.org/about/team#dreamcatcher

<chrchr> radix: A software engineer is somebody who can extend a system without reading any code.
_______________________________________________
Zope-Coders mailing list
Zope-Coders@zope.org
http://mail.zope.org/mailman/listinfo/zope-coders
Re: Checkins for 2.7 and 2.8 and missing unit tests [ In reply to ]
--On Freitag, 3. Dezember 2004 16:13 Uhr +0100 Florent Guillaume
<fg@nuxeo.com> wrote:

> Hi coders,
>
> I must say I'm disappointed with a number of checkins that happened in
> the past month for the 2.7 and trunk of Zope 2: many are missing unit
> tests.
>
> While I understand the need to "fix bugs", I can't see the point of doing
> this without adding unit tests that exercise the problem, and document
> the why and how of things. Just because a patch sits in the collector and
> "works" is no reason to apply it without writing a test, especially for
> subtle features such as quoting and escaping.
>
> Here's a sample of things for which I believe unit tests are important:
>
> http://mail.zope.org/pipermail/zope-checkins/2004-November/028556.html
> no test of webdav escaping
> http://mail.zope.org/pipermail/zope-checkins/2004-November/028562.html
> no test (escaping, cdata)
> http://mail.zope.org/pipermail/zope-checkins/2004-November/028654.html
> no test (local roles)
> http://mail.zope.org/pipermail/zope-checkins/2004-December/028737.html
> no test (clone in webdav)
> http://mail.zope.org/pipermail/zope-checkins/2004-December/028750.html
> no test of ACTUAL_URL and URL quoting
>

I agree with you to some point. There are code areas in Zope 2 where we
have absolutely
*no* tests e.g. webdav. Adding one or two tests to annon-existing test
suite really
does not improve the code quality significantly. I think we have to live
with this
situation in the Z2 land forever. Another point is that you have understand
what the code
does to write tests (and in some cases to fix bugs). But a lot of the Z2 is
badly documented
and hard to understand even with years of Zope experience. So changes like
the
patches for ACTUAL_URL and URL quoting are fine for me without tests since
the changes
can be tested very well through the web instead in an "artificial"
environment as unittests
are at some point. As another example: we are currently working on the
"readonly problem"
in WebDAV & M$ Word. DieterM has tracked this down to some misbehaviour in
Zope and
to a much worser misbehaviour in terms of protocol violation in the M$
Webdav implementation.
There are things you can't test with unittests. Don't get me wrong.
Unittests are perfectly
suitable for development if you use them from the beginning as in Zope 3.
But in Zope 2
there were added very late in the development so the whole bugfixing in
Zope 2 is like
maintaining a half-dead zombie.

Andreas
_______________________________________________
Zope-Coders mailing list
Zope-Coders@zope.org
http://mail.zope.org/mailman/listinfo/zope-coders
Re: Checkins for 2.7 and 2.8 and missing unit tests [ In reply to ]
On Fri, Dec 03, 2004 at 04:37:21PM +0100, Andreas Jung wrote:
> I agree with you to some point. There are code areas in Zope 2 where we
> have absolutely
> *no* tests e.g. webdav. Adding one or two tests to annon-existing test
> suite really
> does not improve the code quality significantly.

It does in one way. When I go to fix a bug, if I found there was a test
suite for the module or class in question with even one stupid test
in it, I would breathe a sigh of relief, because it's usually
straightforward to add the tests I want to an existing suite.

OTOH, when I have to add my own test suite from scratch, I frequently
have found that I end up wasting half a day just getting the
%@#)% thing to run at all, depending on what I'm trying to set up
and what evil snags are lurking under the surface.
(Example: I wasted a lot of time tearing out my hair on this
one before I realized it had nothing to do with my new tests...
http://zope.org/Collectors/Zope/1357 )

So IMHO adding a test suite with one test in it *does* add value -
it is a potentially significant timesaver for future test writers.

Lately I've been trying ZopeTestCase and found that it does
indeed simplifiy test setup in the common case. Whew.

> I think we have to live
> with this
> situation in the Z2 land forever.

Sad but probably true.

--

Paul Winkler
http://www.slinkp.com
_______________________________________________
Zope-Coders mailing list
Zope-Coders@zope.org
http://mail.zope.org/mailman/listinfo/zope-coders