views:

104

answers:

3

Hi all,

Here is what I want to do:

1) A running application has been instrumented. The byte code is clean - means that the tracing info should be added on the byte code level.

2) The running application might run for days or weeks. I want to have a trace file once per day.

3) If the tracing period is over I want to merge all trace files together and produce one HTML report for the developers.

Here is what I have investigated so far:

  • Emma seems to do a good job when it comes to issue 1) Instrumentation on the fly is very simple.

  • Cobertura says the are able to do byte code instrumentation but I havent found an example.

  • Neither Cobertura nor Emma talk about periodical trace file dumping.

  • Im not sure about clover. Maybe somebody has had a look at it before.

Has somebody done this before and can help me with these Issues ?

Thanks, detlef

+2  A: 

Cobertura will instrument your code fine. It will dump out .ser files that can be merged together.

The only part I have not tried is taking a snapshot every day. My two ideas are to try to either

a) What happens if you copy the .ser file off, and delete the old .ser file. Will it crash, or will it create a new .ser file? If it creates a new file, this would work.

b) Would it be possible to shutdown your app for 1 minute per day, to copy and delete the .ser file?

In either case, once you have a bunch of .ser files, it is real easy to merge them toegether and create a html report.

bwawok
+1  A: 

Clover is also nice.

TTMAN
A: 

Our SD Java Test Coverage Tool allows you at execution time to dump a test coverage snapshot at any time you like by calling a special method.

If you have a long running application and want a daily snapshot, you could add an extra thread that waited 24 hours, dump the snapshot, go back to sleep. Each snapshots gets its own date-stamped file. You can merge as many of these together as you like, and produce an XML coverage report (and then an HTML report in the format you like).

Ira Baxter