[Bioc-devel] [BioC] NAMESPACES, export, and unit tests

Seth Falcon sfalcon at fhcrc.org
Tue May 2 00:01:47 CEST 2006

Herve Pages <hpages at fhcrc.org> writes:

> But the question is: do we consider it a feature for the unit tests
> not being able to access the non-exported objects in the normal
> way... or is it a bug?

I would say that the "normal" way to access non-exported objects is to
not access them :-)

IMHO, unit tests should focus on the exported API.  Part of the value
that unit tests give you is that when you change implementation, they
tell you whether or not you broke anything.  If you instrument your
code with unit tests at too fine grain a level, every code change will
require a test change.  That gets boring quickly.

So I guess I would argue that it's a feature :-)

> I'm asking because there seems to be other things that you can't do
> in the unit tests (like defining S4 classes or dispatching on an S4
> class defined somewhere in the package, I don't remember exactly).
> I'm wondering what's the motivation behind these restrictions...

If you are interested, how about some specifics on what doesn't work.

I don't think there is any "motivation" behind the observed
restrictions.  Certainly there are limitations of the current S4
implementation, but I do not believe anyone has sat down and said,
"let's make this particular thing not work for people wanting to do
unit testing".

+ seth

More information about the Bioc-devel mailing list