Multiple steps on a relatively large code base

Piergiuliano Bossi February 28, 2013

We have been using Clover driven by ant on a Jenkins build for quite some time now. The code base has grown and it's relatively large: roughly 500K NCLOC, 8500 files, 9000 classes, 8500 unit tests, 1700 acceptance/integration tests. The Jenkins build runs at night and it's quite resource intensive: for example, it requires 3 GB of memory to both compile and run all the tests.

We are wondering whether we can split this in multiple steps, so that the memory requirements are smaller, but all the data is still collected as it was run in one step and the historical reports work in the same way.

Can anybody shed some light and provide some guidance about this?

TIA, G

1 answer

1 accepted

1 vote
Answer accepted
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 28, 2013

Hi Bob,

There are at least few possibilities:

1) You can split your project into several smaller modules. Instrument, compile and test them separately. Each of them will have it's own <clover-setup/> task and multiple clover.db files will be produced. After the build merge all databases using <clover-merge/> task in order to have a single Clover report.

2) You can define <fileset includes="..." excludes="..."> for <clover-setup/> and measure code coverage for most important code areas only. I recommend to exclude all generated code from instrumentation.

3) You can disable per-test code coverage (if you don't need such detail) recording. Thanks to this no clover.db*.s files will be produced (I guess that you have at least 10'000 of such files produced).

How to do this: in the <clover-setup> define that there are no test sources, e.g. <testsources dir=".." excludes="\*\*">

Main drawback: test results will not be collected by Clover so in the HTML report you have to add them manually (<clover-report>...<testresults>).

4) You can disable per-test coverage syntax highlighting in HTML report (it's disabled by default) - see <clover-report> ... <current showUniqueCoverage="false">. Clover will consume much less memory.

5) You can reduce instrumentation level from "statement" to "method" - see <clover-setup instrumentationLevel="method">. Main drawback is the much lower accuracy of course.

Cheers
Marek

Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 28, 2013
Piergiuliano Bossi March 1, 2013

Thanks Marek. A Few comments:

  1. clover-merge is probably our best option
  2. we don't have much generated code, so it wouldn't make much of a difference
  3. we like the idea of having all the details
  4. I may play with this
  5. we prefer to work at the statement level

Thanks again!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events