Information Technology Reference
In-Depth Information
execute, and then schedule periodic intervals to run component tests
(or after commit builds) and then another interval scheme for system
tests? Those intervals can be increased as iterations come to a close,
and you probably want to run them more often in the initial project
stages too.
Frameworks like NUnit for .NET and versions of JUnit and
TestNG for Java have annotations that make categorizing tests quite
easy; in other frameworks, segregating tests is a bit more challenging.
For example, with older versions of JUnit, there is no mechanism
within the framework itself or within Ant to easily divide tests into
three groups. This still can be achieved, however, with a simple nam-
ing scheme or, even easier, with an appropriate directory strategy .
One practice for developer testing is to place unit tests in a sepa-
rate directory from the source code. For example, a project directory
structure would have a src folder for the source code and a test
folder for associated tests. A sample project could have a root direc-
tory like that shown in Listing 6-7.
LISTING 6-7
Sample Project Directory
root
build.xml
build.properties
src/
test/
The src directory contains directories that hold source code, while
the test directory is further divided into more specific directories such
unit , component , and system . For example, the directory listing
would appear as shown in Listing 6-8.
Directory Listing of test
LISTING 6-8
test/
unit/
component/
system/
The unit , component , and system directories in Listing 6-8 hold
associated tests for each category. The system directory, for example,
Search WWH ::




Custom Search