5. <merge>/merge

<merge>/merge — offline meta- and runtime coverage data compressor.

5.1. Description

<merge>/merge is EMMA's offline meta- and runtime coverage data compressor. It reads in an arbitrary number of data files containing class metadata and/or runtime coverage data and compresses all of it into a single session data file.

Why merge? Despite the fact that all other EMMA tools can do in-memory merging of an arbitrary number of input data files, there are valid reason for using <merge>/merge tool:

keeping everything together

Coverage metrics for a particular application could be determined by a large set of meta- and runtime coverage data files, not necessarily collected in a single application run. For example, a Swing client could run in one JVM and a remoted server in another, possibly on a different host machine. Or a testsuite could be spread over a sequence of forked JVM processes.

Collecting all EMMA data in a single file could be a simple matter of convenience: such a coverage session data file is a memento of a particular state of application coverage. Such a session data file contains all the data necessary to regenerate all coverage reports (for source code embedding in a coverage report you also need to preserve the particular versions of sources used at the instrumentation time: a source revision control system is a good solution for this).

data compaction
When merging data into existing files, for reasons that have to do with performance and making file writes as transactional as possible, EMMA tools use an append-like technique. Once a given data record is written to a file, it is never overwritten (rather, later data writes implicitly override it). What this means is that EMMA's un-merged data files may not always store data in the most compact way possible. Processing them with <merge>/merge eliminates wasted file storage and recovers disk space.