Friday, July 23, 2004

Unit testing our server code - List of tools we're using... - Part 2

I missed a tool in our list of tools we're using for unit testing ... We also use Xalan J - A little 15M library for XSLT stuff, that the ant junitreport tool needs to covert the xml output generated by the testcases into nice html output...

The process for checking code coverage:

ant clean - start from a clean slate :)
ant [jarfile] - compile everything, obfuscate the library and generate a nice little jar file... all of the tests need this jar, so it's an important task...
ant coverage - run through our unit test cases... this task depends on our ant "instrument" task (in which class files are run through the jcoverage instrumenation process), and the ant "allTests" task which sets up a temp test directory and starts batch running our unit test cases... all of the output from the testcases goes in a reports directory... and the code coverage information builds up in the temporary directory...
ant junitreport - calls the junitreport to convert the xml output in the reports directory into human friendly html output in a reports/html directory...

Once the process if running well for everyone we'll create a ant runAllCleanCoverage that will do everything we need above...

At the end of the process, we have two useful reports:
Testcase results in reports/html
Codecoverage results in build/instrumented/reports

0 Comments:

Post a Comment

<< Home