On Mon, 5 Apr 2004 11:00:59 -0400
Paul Winkler <[EMAIL PROTECTED]> wrote:
> On Mon, Apr 05, 2004 at 09:44:30AM -0400, Casey Duncan wrote:
> > On Sun, 4 Apr 2004 17:50:13 -0400
> > Paul Winkler <[EMAIL PROTECTED]> wrote:
> > > I've posted my proposal:
> > > http://dev.zope.org/Wikis/DevSite/Proposals/SanitizeHelpSysAndAPIReference
> > I am 100% for this proposal and I have been thinking on and off
> > about the same thing for years. I agree that we need to create
> > interfaces everywhere. With that I propose the following to prevent
> > future help skew:
> > - That all interfaces in the system be verified in unittests.
> Pardon my ignorance, but what tests can you write for an interface?
You can verify that a class or object implements an interface using the
Verify module of the Interface package. It give you at least some
protection against interface changes. It doesn't protect against all
skew (the object can implement a superset of the interface and still
verify), but it at least performs a sanity check.
Whenever I write tests, the first one is generally an interface check.
It might be nice to think about ways to make this check more rigorous.
For example, methods protected by permissions or marked public should
*always* be part of an interface. We could write a check to make sure
that the interfaces implemented by an object cover all of the published
API of that object. The deep inheritance in Zope2 might make that
tricky, but it's food for thought.
A *very nice* side-affect of all this will be that we will have
interface coverage throughout Zope2 (and at least minimal test coverage
to check the interface). This will obviously help integrating with Zope3
down the line.
Zope-Dev maillist - [EMAIL PROTECTED]
** No cross posts or HTML encoding! **
(Related lists -