This is great theory, but Paul is correct in stating that sometimes it is impractical. I have worked on sites with server-side code that was far too complex to be tested in that manner. It would simply be impossible to test them as "stateless" or "stored-state". You traversed the sites in a certain sequential order, or not at all. So each test case would have to start from the beginning, and it would literally take days to run one set of tests. If you have days to spare each time you test a site, go for it. Most people do not.

Testing theory is wonderful stuff, in theory. But occasionally it runs up against practice that does not conform to the theory. Welcome to the real world.

Lonny Eachus
==========

Subject:
Re: [Wtr-general] invoking tests in right order
From:
"Phlip" <[EMAIL PROTECTED]>
Date:
Tue, 7 Nov 2006 08:34:18 -0800

Paul Carvalho wrote:

Bah!  Lectures!  You want to lecture me on how to test!?

No, I wanted the fetched Google pages to lecture you.

If my focus were on Unit/Integration Testing, I would likely agree with
you.  That is, you set up the tests, perform the required steps and checks
and then tear them down to a known, good state.  If you do that, why should
you care what order you run them in?  However, I am a System/Black-Box
tester and during a particular test run, the system gets into fairly complex
setups that would be rather stupid to close the web browser between each
test.  There is no *reset* between tests.

That is an example of poor design-for-testing. Regardless how complex a user may find a path from program load to some given state, tests should simply have a back-door to that state, such as test resources with fixed data tables.

However, there are much more excessive examples of poor design-for-testing than just using GUI tests to test the back-end, so carry on!

Just as everyone's definition of what a "test" might be, so we should
respect that the order in which the tests need to be executed may be
different.  The addition of the feature to specify an order to the test
cases is a valuable one that acknowledges that Watir is not only a tool for
unit/integration/developer testing.

Then prefix all the steps methods with step_, and call them all from one test case:

 def test_universe()
    step_bigBang()
    step_inflationPhase()
    step_condensatePhase()
    step_quasarIgnition()
  # etc
  end


_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to