You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Greger <bo...@gregerhaga.net> on 2006/09/19 07:17:51 UTC

hmm..testing with mod_perl and lwp

Okey so this is the situation I have right now:
0)mysql based application
1)server with mod_perl
2)client is browser for time being, might be a mobile terminal or "custom
client application" in the future
3)testing ( with perl-unit )
3.1)testing package method functionality separately from the ui
3.2)testing web interface of the entire application with LWP::UserAgent and 
XML::XPath
4)transformation of XML web interface to XHTML with XSLT.

This all works very well. I can test and verify each package method, as well
as each XML page that is returned by the server and validate that all elements
are there and has correct content.

The thing is:I'd like to discuss the issues that might arise as the
development goes on further with this way of working. As for now, I am happy
with what I am doing, it feels quite good and correct:but=>if anyone has
experience working this way I'd like to know what you/they have experienced.

Comments and feedback welcome, ( as always )

Thank you
Greger
--
QxRSSReader v1.2.6a released (30-06-2006)
PortScanner v1.2.2 ( 09-08-2006 )
http://www.gregerhaga.net/
There are no stupid questions, but there are stupid answers.


Re: hmm..testing with mod_perl and lwp

Posted by Michael Peters <mp...@plusthree.com>.

Greger wrote:
> Okey so this is the situation I have right now:
> 0)mysql based application
> 1)server with mod_perl
> 2)client is browser for time being, might be a mobile terminal or "custom
> client application" in the future
> 3)testing ( with perl-unit )

I usually use Test::Class and Test::More, but that's my preference.

> 3.1)testing package method functionality separately from the ui
> 3.2)testing web interface of the entire application with LWP::UserAgent and 
> XML::XPath

Again, I use WWW::Mechanize, Test::WWW::Mechanize and maybe Test::HTML::Content

> The thing is:I'd like to discuss the issues that might arise as the
> development goes on further with this way of working. As for now, I am happy
> with what I am doing, it feels quite good and correct:but=>if anyone has
> experience working this way I'd like to know what you/they have experienced.

One of the main irritants in testing the UI of a web application is that it can
change quite frequently. Now changing your tests when the program changes is to
be somewhat expected, but depending on the changes, it can get annoying. I would
recommend against testing for a specific structure and just testing for the
data. But hopefully most of the markup is abstracted enough that most UI changes
are done in the style sheets. Even with this irritant, these kind of tests have
caught many bugs for me that straight unit-testing would not have found.

-- 
Michael Peters
Developer
Plus Three, LP