Information Technology Reference
In-Depth Information
wrote unit tests for the code that was changed, based on defects. We
configured the Ant build scripts to run all the unit tests and publish a
report for every build.
The following steps demonstrate how you can use the CI system to
enable automated regression testing on your project.
1. Write test code for all of your source code (an xUnit framework
is a good place to start).
2. Run tests from your build script (Ant or NAnt are the most
common).
3. Run tests continuously as a part of your CI system so that they
are executed at every checkin to the version control repository
(using CruiseControl or a similar CI server).
And as simple as that, you have automated regression testing on
your project! We discuss more about making your tests an integral part
of builds, at all levels, in Chapter 6.
Scenario: Test Coverage
If you write and run tests, you view the results but you also want to
know how much of your code is actually being tested. Since most of
the unit testing on our project was manual before our CI system, there
was no way to independently verify that the tests were executed. How
does the manager determine how much was actually tested? Consider
the following interaction.
Evelyn (Manager): Did you run unit tests before you committed your
changes to the repository?
Noah (Developer): Ye s .
Evelyn: Great. How's it going on the other feature you are implement-
ing?
What didn't Evelyn ask? Let's try it again.
Evelyn: Did you write new tests or update existing tests for your new
code?
Noah: Ye s .
Search WWH ::




Custom Search