links

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.

Apache Ant Project Ant is a portable, Java-based build tool designed to support software builds-and many other tasks on any platform supporting Java. An XML file known as a buildfile specifies which tasks Ant follows when building your project. Ant ships with many tasks that perform operations ranging from compiling code to playing sound files when a build finishes. Java classes implement Ant tasks that can do anything Java can do. The Ant API is open and designed for extensibility; you can write your own custom tasks if the need arises.

JUnitUnit testing is at the heart of our business. The unit testing technology employed by Illume is based upon JUnit, available from www.junit.org, and is the de facto standard for Java unit testing. It is a simple framework for creating automated unit tests. JUnit test cases are Java classes that contain one or more unit test methods, and these tests are grouped into test suites. You can run tests individually, or you can run entire test suites.

Watij (Web Application Testing)

Watij

Watij (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.

HttpUnitHttpUnit, available from www.httpunit.org, is an open source Java library for programmatically interacting with HTTP servers. With HttpUnit, your Java programs can access servers directly, without the need for a browser. HttpUnit provides an API for parsing HTML, submitting forms, following hyperlinks, setting cookies, and performing many other tasks normally associated with web browsers. It also includes a class library for direct manipulation of servlets, sometimes bypassing the need to start a web server.

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.

JsUnitJsUnit is a Unit Testing framework for client-side (in-browser) JavaScript. It is essentially a port of JUnit to JavaScript. Included is a platform for automating the execution of tests on multiple browsers and multiple machines running different operating systems. JsUnit compliments HttpUnit and the two can be used together in the same Test Framework to enhance your code coverage.

Mock Objects

Writing 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.

Cobertura

Code 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.