JUnit (Beck and Gamma, 1998a; Fowler, 2000) is a Java framework that assists in the definition of automated tests. Testing is an important and obligatory part of the eXtreme Programming approach for software development (Beck, 1999; Beck and Fowler, 2000). This chapter provides a brief UML-F based documentation of JUnit and a set of JUnit adaptation cookbook recipes. It shows how they can be used to guide its adaptation process. Thus, it illustrates how UML-F annotations and cookbook recipes assist in framework adaptation, demonstrating an effective way to support the required adaptation steps.
In this chapter we use a simplified version of JUnit. The source code for this version and for the sample adaptations described in this chapter is available at http://www.UML-F.net. Since the chapter focuses on a sample use of UML-F, it deliberately omits some details of the JUnit framework and its design. The Java source code of the complete version of the JUnit framework, and additional documents, are available at the JUnit's web site http://www.junit.org