next up previous contents
Next: Patterns of Uses of Up: Test Data Requirements Previous: Test Fixture   Contents


Source of Test Data

Although test data may be very different from one application to another, and although test data may be used differently by different applications, test data are usually stored in certain ways. Therefore, locating and accessing test data depends on their source.

Ideally, the test case need not know anything about the source of its test data. The test case needs to be able to request test data from a test data repository by the name of the test data. Thus, Repo will represent a test data repository that assists programmers in locating and accessing test data.

A concrete implementation of a test data repository needs to know how to access the source of its test data and how the test data is organized. Sources of test data are only limited by programmers' creativity. Usually, though, the source of test data is a file. In Java, a file could be located in the file system, or a file could be a resource located in the classpath. Presuming that the two possibly most common sources of test data are files and resources, Repo will represent a framework of classes that assist programmers in locating and accessing files from the file system and resources from the classpath. (See figure 2).

Figure 2: Source of test data are files and resources
\includegraphics[scale=.4]{source.eps}


next up previous contents
Next: Patterns of Uses of Up: Test Data Requirements Previous: Test Fixture   Contents