![]() ![]() ![]() The following testing related tools derive from open-source projects that compliment each other. Illume has a wealth of hands-on experience at building and implementing Test Framework solutions using these tools.
Watij (Web Application Testing) WatijWatij (http://watij.com) is a Java API that provides control and automation of Internet Explorer in order to test web applications. It was created out of the need to have a reliable, easy to use, and robust web application testing tool using Java as the scripting language.
Despite its name, HttpUnit is not a testing tool. Instead, it provides an API for interacting with HTML and HTTP servers. You normally think of HttpUnit as a testing tool, however, because you use HttpUnit in conjunction with JUnit to write tests. JUnit defines the testing framework and your testXXX( ) methods use the HttpUnit API to access and test web pages.
Mock ObjectsWriting tests for simple, standalone Java classes is easy. Just create an instance of your class and run tests against its methods. But testing gets a whole lot more interesting for classes with complex dependencies on other parts of your application. When testing becomes difficult, consider refactoring your code in order to minimize dependencies. But there will always be cases where classes cannot be tested in isolation. A mock object (www.mockobjects.com) is a "fake" implementation of a class or interface, almost always written for the specific purpose of supporting unit tests. When writing JDBC unit tests, you might create mock implementations of interfaces such as Connection, ResultSet, and Statement. In the case of Swing code, you might create a mock implementation of the TableModelListener interface. You create mock objects that always return well-known data and your unit tests use these to exercise your application logic without relying on real objects or databases. CoberturaCode coverage is a measure used in software testing. It describes the degree to which the source code of a program has been tested. It is a form of testing that looks at the code directly and as such comes under the heading of white box testing. Code coverage techniques were amongst the first techniques invented for systematic software testing. Cobertura (http://cobertura.sourceforge.net/index.html) code coverage is a Java based tool that integrates well with Ant and your Junit based Test Framework. ![]() ![]() |