Benefits of Integrating Testing into Ant
Beyond the benefits of automating the testing process in general, integrating the testing process into the Ant build process has additional benefits:
The integrated testing process is likely to be used.
Integrated testing stresses the importance of testing early and often.
Enforcement of testing standards is easier.
Testing is consistent over every version of the software project.
By including the testing process inside the Ant build process, the likelihood that the process will be used increases enormously. If the process is as simple as performing a task that the developers do many times a day, many of the typical excuses for skipping the process are eliminated. If a process precludes the developers from executing it, the benefits of the process can never be realized.
Another benefit of placing the testing process inside Ant is that it enforces the idea that testing is part of the development process, not just something to be done by a testing group prior to shipping. Testing is conducted at many levels to test various aspects of the application. By including testing throughout the process, bugs can be found earlier, fewer mistakes are repeated, and problems are found closer to the time when they are introduced.
Finally, including testing in the Ant process provides for easier enforcement of the testing standards. Ant targets can be developed to ensure that all classes have a unit test created for them. We will look at techniques for accomplishing this in Chapter 9, "Company ReorganizedWorking with a New Subteam," and Chapter 10, "Additional Teams Adopt the XP Process." The Ant build process can enforce the stipulation that tests must be run at certain points, such as before deployment. Ant also can enforce that all tests must pass before moving on to subsequent steps. By allowing Ant to enforce these standards, the development team is freed up to focus on developing production-quality code.