Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Introduction

Emma is an open source code coverage tool. In our case, Emma enables code coverage by instrumenting the target code. The instrumentation process involves Emma looking at the class or jar files and adding its own layer between the JVM and the code normally called.

During the Instrumenting process, metadata is created per class. This metadata is stored in files locally. In our situation, we generate one meta file per webapp.
The instrumented code has an extra port open, which can accept commands from Emma such as return coverage information or reset coverage information that resides in memory.

To generate a full report Emma requires:

  1. the code has been compiled with the debug option on
  2. the source code is available,
  3. session data is available in a local file,
  4. a relevant metadata file exists.

Command line recipe

Prerequisite

  • The highest version (build 2.1.5320) emma jar file needs to be downloaded from Emma home. The jar needs to be placed in {$JAVA_HOME}/jre/lib/ext

...

  • or

...

  • added

...

  • to

...

  • the

...

  • classpath

...

  • of

...

  • the

...

  • following

...

  • commands.

...

  • This

...

  • is

...

  • also

...

  • true

...

  • for

...

  • the

...

  • JAVA_HOME

...

  • seen

...

  • by

...

  • the

...

  • Sakai

...

  • server.

...

  • the

...

  • source

...

  • code

...

  • is

...

  • available

...

  • for

...

  • report

...

  • generation

...

  • Info

...

  • title

...

  • Condensation

...

  • of

...

  • source

...

  • code

...

  • I

...

  • have

...

  • written

...

  • a

...

  • simple

...

  • Perl

...

  • script

...

  • that

...

  • copies

...

  • all

...

  • the

...

  • source

...

  • code

...

  • into

...

  • one

...

  • directory

...


  • structure

...

  • instead

...

  • of

...

  • being

...

  • scattered

...

  • under

...

  • the

...

  • java/src

...

  • directories.

...

  • This

...

  • allows

...

  • report

...

  • generation

...

  • for

...

  • all

...

  • reports

...

  • to

...

  • point

...

  • to

...

  • the

...

  • same

...

  • source

...

  • code

...

  • directory.

...

  • Javac compiles the source code with debug option on
    Info
    titleMaven

    Running maven pack-demo compiles with debug on by default

Generate report

Reset in memory coverage session data