Dec 3, 2008

HttpUnit - web page testing

Two weeks ago my professor gave us an assignment about testing web applications.
It is well-known fact that testing web pages is very hard by its characteristics.

One tool that professor suggested is HttpUnit:
http://httpunit.sourceforge.net/doc/cookbook.html

It is not so much surprising in the sense of technology. However, it had very interesting interface to test web pages. Most of web page testing tools mocks the behaviors of web browser. Some of them actually records tester's clicking.

One way I have come up with is using cURL to retrieve a web page and find out certain text messages by Regular-expression. By its nature web pages contains very flexible format, so that it should be check by powerful text message checker such as Regular-exp.

One of the approach of HttpUnit is parsing the HTML page into DOM tree, and returns some of parts that are interested to testers. The syntax gave me the impression that it seems like JavaScript syntax.


However, we still have difficulty of web page testing. HttpUnit requires that the target web pages had to be deploied on web server, which takes fairly long time. I don't think we can skip the deploying part for testing. We need to test the very last result, which should be resulted by a web container. For this problem, we may need a light-weight web application server inside of IDEs.

Flight searching system on J2EE

I just have finished one of my project for this semester. It was SWE642, "Software Engineering for WWW". The class was mainly about J2EE, which I hadn't know much.

The class asked us to develop a flight reservation system. It gave me a big chance to catch up modern web programming technologies:
  • Spring Framework.
  • Hibernate persistence framework with Hyper Sonic database.
  • Log4j log library.
  • ANT building system.
  • AXIS2
  • Google Map 2
  • Tomcat, of course.
You can download it and deploy it on your local computer, if you are familiar with SVN and Tomcat:
http://code.google.com/p/weneedourownproject

I'm proud of myself, and I have learned a lot about Spring Framework. It was nice especially for JUnit testing. It gave me unit testing and integration testing environment.
However, I don't think I will have any more chance to touch web programming technology, because I wouldn't develop web application, unfortunately.