views:

397

answers:

4

I need to estimate the code coverage of a test set. The tests are run on a J2ME application, on a physical device. MIDP 2.1, CLDC 1.1 and JSR-75 FileConnection are available. As J2ME is (roughly) a subset of J2SE, tools using java.io.File (like those listed in the only answer so far..) can not be used.

This is mainly to identify pieces of code the tests do not touch at all.

It would also be nice to be able to combine the report data arbitrarily afterwards, so I can see how much a new test actually increases coverage.

Are there any alternatives to Cobertura4j2me?

A: 

Here's a slew of alternatives.

http://java-source.net/open-source/code-coverage

not-bob
Although there is a pretty big list of tools there, few if any of those will work with J2ME.
Skrud
+1  A: 

There's lots of Java code coverage tools. Many of them work by using JVM features not available in embedded systems due to space limitations.

One that uses only an additional boolean array in which to hold the coverage data can be found at

http://www.semanticdesigns.com/Products/TestCoverage/JavaTestCoverage.html

You have to code an additional routine that dumps that array out of your embedded device into a file on a PC, but that's generally a pretty easy task (e.g., several hours work, once).

Ira Baxter
A: 

When CLDC1.1 and the JSR75 FileConnection API is available check this one: http://www.cobertura4j2me.org/ .

Márton Németh
@Márton - that link is included in the question ...
martin clayton
A: 

May i know tool names those works for J2ME?

Vishal