On Sun, 27 Feb 2005 10:21:33 -0500, Joel Gwynn <[EMAIL PROTECTED]> wrote:
> What do people use for automated testing of their CGI::Application apps?
> How about testing things like user account creation forms, use menus,
> and they myriad of options that can be selected, and things that go
> wrong?

I've used WWW::Mechanize successfully for this task.  It allows you to
walk through the website and click on buttons or links and submit
forms.   Test::WWW::Mechanize adds a nice set of testing functions
around the WWW::Mechanize interface.

You can also use Test::HTML::Lint which provides a testing framework
around HTML::Lint for doing HTML validation (also see HTML::Tidy and
Test::HTML::Tidy which is intended to replace HTML::Lint).

The drawbacks of this system is that you need a webserver to do the
tests, so it is easy to do the testing on your development box, but a
little bit more tricky on a production machine.  The Apache::Test
framework might help here which will actually provide you with a
working webserver in a testing framework.

I find the biggest problem with doing proper testing of a web
application is that it is so time consuming...  There are so many
possibilities when using a web application, and catching all the edge
cases can be tricky.  A possible way to simplify this is to use
something like HTTP::Recorder, which can be setup as an HTTP proxy and
will record all transactions that go through the proxy and
automatically generates a WWW::Mechanize script that can be used to
replay the entire transaction.

So you could set this up, and then let your testers go nuts with the
application, and then replay all their transactions in the future... 
You can also take the resulting Mechanize script and pepper it with
Test::WWW::Mechanize checks to write your test scripts.  Half of the
work will be done for you.

Of course this only tests the frontend of the application.  It is
probably worthwhile to test your data objects directly as well, and
any utility functions.  But those can be tested with more traditional
testing methods.


Cheers,

-- 
Cees Hek

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to