Jachin Rupe wrote:
> hi there
> I'm new to Zope development from the PHP realm. When I worked in PHP I
> would, write a little code, save it, refresh the browser and see what
> Initially I tried to do that in Zope and as you can imagine I decided
> very quickly that having to restart Zope after I made every change and
> then waiting for it to restart was just not going to work.
> (bunny trail: I've got a 1.67 ghz G4 PowerBook with 1 gig of Ram, is "
> root Startup time: 32.328 sec real, 16.860 sec CPU" about where I should
> be or am I doing something terribly wrong if it's taking me that long to
> start zope?)
Nope. I've got a 1.33 G4, so I need about the same amount of time.
Of course, you *can* speed up the start up a little bit by disabling all
the stuff you don't need. ZCML execution isn't exactly fast, so any
package you don't need and can live without, even if it's only for the
moment, saves you startup time.
> After some reading it sounds like the way to go with Zope is to just
> write lots of those "tests", which run much much quicker. So my
> development processes looks something like this:
> 1. write code
> 2. write tests
> 3. run tests
> 4 debug
> 5. repeat steps 1-4 until there's a whole bunch of new features and I
> can't stand not trying them out.
> 6. restart zope and try things out.
> Is that how Zope 3 development is supposed to work?
This is definitely a good way of reducing the amount of restarts one has
to make. Typically, I write at least the basic unit tests for components
before I think about their ZCML registration or even starting up Zope.
Often, I also write science fiction tests, meaning, I first write a test
that illustrates how I'd like the component to behave, and then I
implement the component until the tests pass.
Either way, writing the basic unit tests definitely will catch "stupid"
errors immediately, such as import errors, typos, etc.
> Right now I'm concerned about what will happen when I start testing the
> security and the design (skin). My guess is there are mechanisms to
> write tests to try out the the security settings
Of course there are. We call those functional tests and usually write
them using a test browser (see zope.testbrowser). For more info on
functional tests (though not on the test browser as it's more recent
technology), I can refer you to my book, http://worldcookery.com.
> but if I makes design
> changes I obviously can't look at those via the command line.
ZPT pages reload without having to restart Zope, which is a big win
during the layouting phase.
Zope3-users mailing list