Friday, February 22, 2008

Web Testing Framework released

This week I released my first open source testing project.

Hanno is a test automation framework in Java for dynamic model-based exploratory testing of web applications. It can be used to develop an automated testing tool for most web applications.

Hanno is built on several open standards and tools:

  • SCXML, an XML language based on Harel state charts.

  • Apache Commons SCXML, an SCXML implementation in Java.

  • Watij, a web application testing tool in Java.

Hanno implements a model-based test automation approach. To test a web application with Hanno, an SCXML model is created to describe the application behavior. A Java class is created with methods for each event or state in the model. Each method calls Watij code to execute the event in Internet Explorer, or to verify that the browser is in the correct state. The Java class is run by an engine with a simple algorithm to determine which event to execute next. The order of test execution is not predetermined.

Modeling a web application in SCXML is not difficult, but does require familiarity with state charts or finite state machines. I found SCXML quite easy to learn and understand. Hanno includes a simple example application to help get started.

Debugging a Hanno test tool can be a complex process, however, because it requires getting the SCXML model and the Java code that the model executes to work together and both be correct at the same time.

I recommend starting small, by modeling a simple behavior of your web application, testing it, getting it to work, then adding behavior incrementally.

I have used Hanno to test several web applications. With experience, a simple model of a web application's navigation can be built in a day or two. A more complex model with hundreds of events and states may require several weeks or a month. The end result can be a test tool than can do the work of hundreds of hand-crafted automated tests, run continuously, and find new bugs because new test sequences are executed on each run.

I developed Hanno primarily to meet my own needs and to implement my own concepts for how a model-based testing tool should work. It can certainly be improved, especially in the area of debugging and error handling. Java developers interested in test automation are welcome to join the project.

I encourage the software testing community to download Hanno and kick the tires. Please use the Hanno forums for any detailed questions or feedback.

2 comments:

Unknown said...

Hi Chris,

In the definition, the
"SCXML, a web application testing tool in Java"

should be changed to

"Watij, a web application testing tool in Java."

The link for watij is ok but the the text reads ScXml.


Rajeev

Chris Struble said...

Fixed. Thanks, Rajeev.

Chris