A.2 JUnit Expansions


A.2 JUnit Expansions

The number of expansions and add-ons developed and maintained for JUnit has grown continuously. Some of them were introduced in Parts I and II of this book.

A current list of these additional tools is maintained on the JUnit Web page at [URL:JUnitExt]. The following list is not complete, but it includes the most important additional tools available at the time of writing this book. To spare the reader from having to look up references in the bibliography, we directly list the URLs in this appendix.

JUnitX and XPTest

JUnitX offers a way to access private or protected variables, methods, and classes in test cases. The tool builds on the latest JUnit version and uses the Java reflection mechanism.

XPTest combines and integrates JUnit and JUnitX in the UML modeling tool TogetherJ. This also allows automatic creation of test cases by using the pattern mechanism of TogetherJ.

URL: www.extreme-java.de/

Daedalos JUnit Extensions

The JUnit extensions of Daedalos allow you to define testing resources that are initialized only once. This can speed up some test suites.

URL: www.daedalos.com/DE/djux

JFCUnit

This expansion allows testing of Swing user interfaces. Chapter 13, Section 13.2, introduced JFCUnit in an example.

URL: http://sourceforge.net/projects/jfcunit/

JUnitPP

JUnitPP expands JUnit by a test data repository, some command line arguments, a built-in iteration counter, and multi-threading from the command line.

URL: http://junitpp.sourceforge.net/

Mock Objects

This library offers both an extensive base of generic mock objects and some specialized packages, for example, for testing of JDBC connections and servlets. The concept of mock objects was described in Chapter 6.

URL: www.mockobjects.com/

MockMaker

MockMaker is a tool that serves to create source code for mock objects and builds upon the mock objects library. The tool starts from an interface and generates classes allowing both the specification of the expected behavior and return of predefined function values.

URL: http://sourceforge.net/projects/mockmaker

EasyMock

This package allows you to define simple mock objects directly in the test code, without the need to write your own mock classes. The underlying Java proxy mechanism is available from JDK Version 1.3 and higher.

URL: www.easymock.org/

JXUnit

JXUnit allows you to separate test data from the test logic by dumping the test data into XML files. This is more interesting for functional test suites than for fine-grained unit tests.

URL: http://jxunit.sourceforge.net/

JUnitHelp

JUnitHelp offers general information and tips about the use of JUnit in HTML and JavaHelp format.

URL: www.bossicard.com/projects/junit.php

Joshua

Joshua was designed for the distributed execution of regression tests, based on Jini and JavaSpaces, in addition to JUnit.

URL: http://cs.allegheny.edu/~gkapfham/research/joshua/

JDepend

JDepend makes its way hand over hand through a set of Java class files and Java source directories and for each package, determines metrics on dependencies upon other packages. Properly interpreted, the figures provide hints about expandability, reusability, and maintainability of a package. You can test automatically for permitted tolerances of specific measurement values in JUnit test cases.

URL: www.clarkware.com/software/JDepend.html

JesTer

JesTer uses the mutation testing approach to offer a completion to conventional coverage analyses. This type of testing is based on targeted changes to the application code and subsequent checks to determine whether or not the original test suite detects these changes as errors. This means that you can identify code parts run within the suite, but with effects not verified in the tests. Chapter 8, Section 8.3, classified this approach into the classic coverage analysis.

URL: http://sourceforge.net/projects/jester/

HttpUnit

HttpUnit is a framework to address external Web sites in a Java program. One possible use in combination with JUnit is to run automated Web function tests. Chapter 12, Section 12.1, introduced this use in an example.

URL: http://httpunit.sourceforge.net/

JUnitEE

This package uses a test runner servlet to run server-side test suites. One possible use is testing EJBs (see Chapter 11, Section 11.2).

URL: http://junitee.sourceforge.net/

Canoo WebTest

Canoo WebTest is a free open source tool for automated testing of Web applications. It calls Web pages and verifies the results, giving comprehensive reports on success and failure. The test scripts are specified in XML as ANT tasks and use HttpUnit behind the scenes.

URL: http://webtest.canoo.com/

Cactus

Cactus is another tool that allows you to run server-side tests. In contrast to JUnitEE, this tool uses proxy servlets, which establish the connection to client test cases. Chapter 12, Section 12.2, introduced Cactus in theory and practice.

URL: http://jakarta.apache.org/cactus/

JUnitPerf

JUnitPerf represents a collection of "test decorators" you can use to check performance and scalability.

URL: www.clarkware.com/software/JUnitPerf.html

J2ME Unit

Java 2 MicroEdition was designed for devices with scarce storage and resources. This means that the virtual machine may not support reflection, making it necessary to adapt JUnit. A JUnit port for this platform, J2ME Unit is available.

URL: www.rolemodelsoft.com/aboutUs/products.htm

Test Mentor Java Edition

To my knowledge, Silvermark's Test Mentor is the only commercial software that supports the same test approach as JUnit and can even run JUnit test cases. In addition, this product offers a large number of additional functions, including graphical tools for test creation and documentation, management generic test modules, and test result management on XML basis.

URL: www.testmentor.com




Unit Testing in Java. How Tests Drive the Code
Unit Testing in Java: How Tests Drive the Code (The Morgan Kaufmann Series in Software Engineering and Programming)
ISBN: 1558608680
EAN: 2147483647
Year: 2003
Pages: 144
Authors: Johannes Link

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net