Christopher Elkins wrote:
> [snipped as appropriate]
> > The package private classes are another good point (which I neglected to
> > mention). I know that this option may sound a bit distasteful, but we
> > could test a lot more thoroughly if we scattered the JUnit test cases
> > throughout the Turbine package tree, and kept only the test suites and
> > base tests in the org.apache.turbine.test package. I know that this may
> > sound weird at first, but tests are really a core part of the code.
> > Turbine is so big now that it's really hard to tell if everything is
> > working--hell, I don't know even what everything *is*, let alone how
> > it's supposed to work. Test cases really help solve this problem, and
> > therefore are really core functionality. This gives them the right to
> > live in the core source tree, and alleviates the headache of maintaining
> > a duplicate package heirarchy under the test package.
> >
> > > I guess it boils down to whether the unit-tests should emphasize white-box
> or
> > > black-box testing. The options I outlined above implicitly assume that
> black-box
> > > testing has priority.
> >
> > Black-box testing is preferable because it means less code to write. ;)
> > The downside of it is that often you can't get the granularity of test
> > cases that might otherwise be desirable.
>
> On the surface this seems unorthodoxed, but I think it makes a lot of sense. And
> unless someone gets really ambitious, it may be quite some time before very many
> tests are written. Therefore, if down the road we find that it causes more
> confusion than not, we can re-think this solution. Also, seeing the test cases
> alongside the original classes might help us remember to create test cases for
> new code. ;-)
Hehe, I like your last point a lot.
> How about the following?
> - Specific test-cases should appear alongside the class to be tested.
> - Test-cases should be named [ClassToBeTested]Test.java. This allows the
> tests to be filtered-out by Ant during distribution builds.
> - "Top-level" test harnesses (if any) should be rooted at
> org.apache.turbine.tests.>
> Unless there are objections, I'll proceed along these lines. I'll also work on a
> doc that explains the method to our madness.
Perfect! I was going to make the naming suggestion myself--you beat me
to it. This will also make determining which classes to migrate to a
test heirarchy easier, if we for some odd reason decide that is
necessary at a later date. The "top-level" test harness is a subclass
of JUnit's TestSuite class, which should be returned by the coarsest
grained TestCase subclasses static suite() method. You can steal
classes that I hacked up for Velocity (or I can port them if you like).
--
Daniel Rall <[EMAIL PROTECTED]>
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]