The Artima Developer Community
Sponsored Link

Why We Refactored JUnit
The Story of an Open Source Endeavor
by Bill Venners, with Matt Gerrans and Frank Sommers
January 27, 2003

<<  Page 2 of 4  >>


A Little Help from My Friends

Initially I got some help from Matt Gerrans, who wanted a Java project to work on to improve his Java skills. Although a veteran programmer, Matt had spent most of the second half of the nineties programming in languages such as C++ and Python. Over many months, Matt and I, in between rounds of foosball, drew circles and arrows on white boards and hacked away at code. The design and implementation of Artima SuiteRunner evolved through much discussion and many iterations.

Frank Sommers became involved with Artima SuiteRunner project after running into limitations using JUnit to test network services. Frank and a group of students from the University of Southern California had built a set of Jini services that formed the infrastructure of a cluster-computing framework. They needed to test not only each Jini service implementation, but also the system as a whole, under a variety of conditions over a sustained period of time. They started to write JUnit test cases, but soon ran into problems.

Their problems with JUnit started even before their initial test would execute. In fact, that was exactly the problem: the first tests would not execute. Jini's infrastructure relies on Java's ability to load classes into a running Java virtual machine (JVM) from any network location. Dynamic class loading alleviates the need to pre-install service implementation code at every Jini client. But Jini's mobile code requires that class loading at a Jini client conform to the delegation-based class loading mechanism specified in the JVM 1.2 specifications. Unfortunately, JUnit's graphical runner did not follow that class loading model, and worked in a way that prevented class loading from the network URLs annotated into their Jini stubs. That made testing Jini services with JUnit's graphical runner impossible. Class loading worked correctly in JUnit's text runner, but that meant having to forgo the graphical UI.

As soon as Frank and his team overcame their initial hurdle by using JUnit's text runner, they encountered a second obstacle. Since each test result represented a sample of the overall system reliability, they wanted to collect many such samples in a format amenable to statistical analysis. They found JUnit's reporting facility simplistic for their purposes. To achieve their testing objective, they faced a choice: extend JUnit's reporting capability, or look for another tool more suitable for their testing requirements.

When Frank Sommers heard about the Artima SuiteRunner project, he tried it and immediately sent Matt and me joyous emails. Even though we didn't know about Frank's problems at the time, our Reporter notion was perfect for Frank's needs. So Frank joined the project and contributed much design insight, code, and time.

<<  Page 2 of 4  >>

Sponsored Links

Copyright © 1996-2018 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use