Winston Wolff wrote:
> What is the state of unit tests for Webware? I know that each kit
> (WebKit, MiddleKit, etc) has a Testing folder, but they don't seem to be
> automated unit tests. It seems to me that automated tests will be
> necessary for Webware to develop further, e.g. to make a 0.9 release, or
> to move over to this WSGI thing. Would people agree?
>
> If they agree, does anybody have any suggestions for how to write a unit
> test that tests the app server? Just off the top of my head, it seems
> like we might have to have a test case that starts the appserver in
> setUp(), and then proceeds with the tests in a different thread. Or
> perhaps we can launch the appserver and tell it to immediately run a
> particular servlet that contains our tests.
That would really be an acceptance test, not a unit test. This is some
of the problem with the current Webware architecture -- it's hard to
separate out units for testing. It would be possible to write
acceptance tests... in some ways that could be as simple as defining
some carefully-crafted servlets that exercise different functionality,
and slurping fixed URLs to see that they work properly. The
WebKit/Testing directory has a number of servlets, but no formal
expected results. And some of them are stateful, which makes it a bit
more difficult; probably those servlets could just be recrafted to avoid
statefulness, or to make that more predictable.
Otherwise, parts could be factored out into more decoupled modules, that
would support unit testing. That's what I've tried to do with WSGI
Webware; though I haven't actually made the tests yet. After a burst of
programming my hands have been acting up, so I haven't made any progress
on the projects for a while, and probably won't for a couple more weeks
(though I'm happy to give anyone access if they want, or move the work
to svn://w4py.org).
--
Ian Bicking / ianb@... / http://blog.ianbicking.org
|