3.28.2. Configuring code coverage for an AUT

You can activate code coverage for an AUT configuration with the following steps:

  1. Open the AUT configuration dialog from the Project properties (Section 3.6.3, “Editing the Project and AUT properties”).

  2. Select the Expert configuration.

  3. Select the code coverage agent you wish to use (JaCoCo is available out-of-the-box).

  4. You can then enter the AUT installation directory and the AUT source directory for the code coverage:

    The AUT installation directory

    is the directory containing the class files (compiled Java files) for your AUT. You must enter this directory to make code coverage possible for your test run.

    The AUT source directory

    is the directory where the source files (i.e. the program code) for your AUT are kept. Entering a directory for the source files is optional, however, if you do not enter one, then you will not be able to view your code coverage results at the source file level. The AUT source directory must contain the source files in their Java package structure. The class files must have been compiled with debug information to make the lines of code executed visible in the code coverage report.

    You can enter relative paths for the AUT installation and AUT source directories. The paths are relative to the working directory.

  5. To make sure you only monitor your own code, enter a package pattern to specify which packages should be monitored. The pattern must be a valid regular expression. If you do not enter a package pattern, all classes in the virtual machine will be considered for the code coverage value.

    Not entering a package pattern can result in extremely large messages being sent from the AUT Agent, which may cause memory problems (Section 3.28.2.1, “Increasing the Java Heap Space for code coverage”).

  6. Select whether you want the code coverage value to be reset when a new Test Suite starts (Section 3.28.3, “Resetting and accumulating code coverage”).

3.28.2.1. Increasing the Java Heap Space for code coverage

Running a test with a code coverage profiler leads to an increased memory requirement for the ITE. You can increase the heap space for the ITE and also enter a package pattern (Section 3.28.2, “Configuring code coverage for an AUT”) to reduce the amount of files considered for code coverage.

Users working with a MySQL database should also follow the steps from the Installation Manual to increase the maximum allowed packet for the database.



Copyright BREDEX GmbH 2015. Made available under the Eclipse Public License v1.0.