Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Java Test Coverage Tool Analyser

IP.com Disclosure Number: IPCOM000014613D
Original Publication Date: 2000-Mar-01
Included in the Prior Art Database: 2003-Jun-20
Document File: 1 page(s) / 36K

Publishing Venue

IBM

Abstract

When testing a Java* application you often receive a 'jar' file with the class files in it. From a test point of view you often need to know that when you execute your tests all of these classes have been excuted. This disclosure shows how you can automatically take the 'jar' file, run your tests and provide information on your test code coverage. By using 'unjar' you can get a list of the classes in the shipped code. Chopping off the ".class" at the end of each line lists classes to test. e.g "javax/security/callback/NameCallback" Now run your java testcases with the "-verbose" option. This profiles all of the classes loaded into Now go through the list of files above looking for the class in the profile output. Count up the number of instances and printout the results.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 100% of the total text.

Page 1 of 1

Java Test Coverage Tool Analyser

When testing a Java* application you often receive a 'jar' file with the class files in it. From a test point of view you often need to know that when you execute your tests all of these classes have been excuted. This disclosure shows how you can automatically take the 'jar' file, run your tests and provide information on your test code coverage.

     By using 'unjar' you can get a list of the classes in the shipped code. Chopping off the ".class" at the end of each line lists classes to test. e.g "javax/security/callback/NameCallback"

Now run your java testcases with the "-verbose" option. This profiles all of the classes loaded into

     Now go through the list of files above looking for the class in the profile output. Count up the number of instances and printout the results.

     This provides you with a report on which classes have been tested and which have been missed. This provides test coverage data on the shipped code. No recompile is needed. Although many tools provide test coverage, the difference here is the automatic link between the code delivered and the test results obtained. Most code coverage tools require you to have the source inorder to provide the analysis. This operates on the compiled code. It also requires very little altering of the testcases to get results of the coverage.

(*Java is a trademark of Sun Microsystems Inc.)

1

java.