clover 2 beta version 2 0a5

Upload: ilie-albu

Post on 05-Apr-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    1/100

    Clover User Manual

    Version 2.0a5

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    2/100

    1. Introduction

    1.1. Starting Points

    If you are new to Clover and want to get it going with your Ant project quickly, try theQuickstart Guide. The Introduction for Code Coverage section provides a briefbackground on the theory and motivation behind Code Coverage.

    If you are upgrading from Clover 1.x, read about what's new in Clover 2, the upgradingguide, and the Best Practices for Clover Integration.

    If you are browsing and interested in seeing how Clover can be used on your project, seeUsing Clover Interactively and Using Clover in Automated builds.

    If you are using a Clover IDE Plugin, see the Plugin Guides section.

    The Clover Tutorial provides a good alternative introduction to Clover.

    For help with Ant, see The online Ant manual at http://ant.apache.org/manual/index.html .Also recommended reading is Eric Burke's Top 15 Ant Best Practices.

    For Clover troubleshooting information, see the Online Forums.

    1.1.1. System Requirements

    JDK Version JDK 1.4 or greater required.

    Ant Version Ant 1.4.1 or greater. Ant 1.6.1 or greaterrecommended.

    Operating System Clover is a pure Java application and should runon any platform provided the aboverequirements are satisfied.

    The Clover IDE Plugins document their own IDE version requirements. Please consult thePlugins Section

    1.1.2. Installing your license file

    You need a valid Clover license file to run Clover. You can obtain a free 30 day evaluation

    license or purchase a commercial license at http://www.cenqua.com.

    To install your Clover license file, you need to do one of the following:

    Place the license file next to the Clover jar file (or next to the Clover plugin jar file, if you

    Clover 2.0a5 User Manual

    Page 2Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

    http://ant.apache.org/manual/http://ant.apache.org/manual/http://www.onjava.com/pub/a/onjava/2003/12/17/ant_bestpractices.htmlhttp://www.cenqua.com/forums/http://www.cenqua.com/http://www.cenqua.com/http://www.cenqua.com/forums/http://www.onjava.com/pub/a/onjava/2003/12/17/ant_bestpractices.htmlhttp://ant.apache.org/manual/
  • 8/2/2019 Clover 2 Beta Version 2 0a5

    3/100

    are running a Clover IDE plugin). Place the license file on the Java Classpath that will be used to run Clover. Place the license file on the file system somewhere, and then set the Java System

    Property clover.license.path to the absolute path of the license file.

    1.1.3. Acknowledgements

    Clover makes use of the following excellent 3rd party libraries.

    Jakarta Velocity 1.2 Templating engine used for Html reportgeneration.

    Antlr 2.7.1 A public domain parser generator.

    iText 0.96 Library for generating PDF documents.

    Jakarta Ant The Ant build system.

    overLIB JavaScript library for popups and tooltips.

    Note:

    To prevent library version mismatches, all of these libraries have been obfuscated and/or repackaged and included in the cloverjar. We do this to prevent pain for users that may use different versions of these libraries in their projects.

    1.2. ChangeLog

    1.2.1. Changes in 2.0a5

    5 May, 2007

    New Features

    [CCD-395] - coverage on test classes is now reported separately to coverage ofapplication classes. You can also optionally nominate filesets that define your testclasses. See the new nested element. This also applies to Cloverhistorypoints. This means that Clover historypoints are once again compatible withClover 1.x history points for those that excluded test source metrics. Note that the historypoint XML has changed to introduce the test source metrics in a separate high-level node.

    [CCD-389] - coverage generated solely by a failed test is now marked orange [CCD-390] - unique coverage a test contributes is now reported on the test results page.

    Source code that is only hit by a single test is high-lighted dark green when that test isselected.

    Improvements

    Clover 2.0a5 User Manual

    Page 3Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    4/100

    [CCD-408] - language level for instrumentation now defaults to the JDK version detectedat runtime

    [CCD-397,CCD-313] - Reports now render better in IE7 and Safari [CCD-398] - reporters now report the database they are reporting on during report

    creation [CCD-401] - header colours for test result pages more distinguishable [CCD-411] - HTML reports are now XHTML1 (transitional) compliant [CCD-420] - improve bottom-left panel and make it more consistent [CCD-416] - click-thru to source line includes visual cue

    Bugs Fixed

    [CCD-419] - AIOOBE if the report-time source is significantly different from theinstrumentation-time source

    [CCD-400] - NPE in ANT when Clover is run from NetBeans [CCD-126] - fixed 's logging [CCD-407] - fixed problem where rapid sequential flushing might lead to missed

    recordings [CCD-415] - fixed lexer handling of \u0000 in source [CCD-418] - TestCase detection breaks when non-test inner class present [CCD-421] - fixed links to mover classes on Historical report [CCD-386] - IOE in some cases if initstring specified manually

    1.2.2. Changes in 2.0a4

    28 February, 2007

    As of this release we've simplified the way Clover integrates with Ant builds. Theclover.jar file no longer needs to reside in the ant/lib (or ~/.ant/lib) directory, and thereis no longer any need to use the task if you were previously.Instead, to make Clover available to your build, simply declare

    New Features

    [CCD-13] - 'Least Tested Methods' report on the dashboard

    Improvements

    [CCD-371] - cenquatasks.jar is no longer needed - use: to

    load Clover2 [CCD-365] - new attribute "projectName" on clover-report task to overwrite report title [CCD-366] - allow report "home" page to be specified: one of "dashboard, overview,

    aggregate, testresults, quickwins, projectrisks"

    Clover 2.0a5 User Manual

    Page 4Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    5/100

    [CCD-368] - add duplicate task name [CCD-370] - support filesets in again [CCD-385] - support interval based flush policies again [CCD-372] - detect testNG @Test class-level annotation [CCD-373] - Optimized HTML report performance and size

    Bugs Fixed

    [CCD-384] - relative="true" attribute not being respected during instrumentation.

    1.2.3. Changes in 2.0a3

    22 December, 2006

    New Features

    [CCD-325] - preliminary implementation of Dashboard summary reportImprovements

    [CCD-306] - report how many test methods were detected [CCD-346] - should warn when overwriting an existing history

    point [CCD-359] - Quick Wins should include complexity in weighting [CCD-360] - Make instrumentation more consistent between task, CLI and Compiler

    Adapter [CCD-362] - support again in , HtmlReporter

    Bugs Fixed

    [CCD-348] - html reports - minor inconsistencies [CCD-354] - Clover license check fails in some non-english locales [CCD-356] - [html reports] percentage bar doesn't render correctly with some localised

    percent values [CCD-363] - doesn't handle srcdir==destdir gracefully

    1.2.4. Changes in 2.0a2

    9 December, 2006

    New Features

    [CCD-353] - new task

    Bugs [CCD-355] - instrumentation results in IOException on Windows

    1.2.5. Changes in 2.0a1

    Clover 2.0a5 User Manual

    Page 5Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    6/100

    6 December, 2006

    This is the first release of Clover 2.x. This initial release addresses the following Clover 1.xfeature requests and bug reports:

    New Features

    [CCD-7] - show coverage by testcase [CCD-64] - report coverage by method [CCD-95] - should be able to choose which columns to show in HTML reports [CCD-158] - add cyclomatic complexity measurement to Clover [CCD-258] - html reports should be client-side sortable [CCD-269] - new column Formats "wideBar" [CCD-276] - New and tasks

    Improvements [CCD-55] - respect deprecated annotation [CCD-72] - should be able to link historical & current html report to each other [CCD-89] - Allow secondary sort order to be specified [CCD-180] - provide runtime logging controls [CCD-223] - Clover's database fragments excessively over time, leading to larger

    in-memory coverage arrays [CCD-233] - need an aggregate package report. [CCD-253] - clover-check should support package globs [CCD-254] - historical reports don't need initstring set [CCD-265] - need a runtime property to disable registration of shutdownhook

    [CCD-288] - historical reports - movers classes should be linked to current report ifpossible. [CCD-327] - put inline help into html reports [CCD-340] - improve java source rendering styles

    Bugs

    [CCD-250] - jdk1.5 with -Xlint and -Werror reports clover's fallthrough switch instr aserror

    [CCD-257] - allow recording-time control of which threadgroup Clover-created threadsget created in.

    [CCD-267] - double counting try statements [CCD-308] - javadoc tags not rendered correctly

    [CCD-311] - clover breaks on JDK1.5 hexadecimal floats [CCD-350] - Annotation definition containing superfluous semi causes parse error

    1.3. What's New in Clover 2

    Clover 2.0a5 User Manual

    Page 6Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    7/100

    Clover 2 is a major rewrite that adds new and unique functionality to help your team get the

    most out of your testing.

    1.3.1. New Feature Highlights

    Coverage By Testcase

    Each source file displays which tests hit which line of code. By selecting a test case, thelines that the test case executed get highlighted. Alternatively, by clicking on a sourceline, the tests that hit that line are displayed. Read More.

    Integrated Test Results

    Test results (pass/fail/error) are now optionally integrated with the coverage report. Errortraces are hyperlinked to the relevant source line. Read More.

    Coverage Cloud ReportsThese give an instant overview on specific aspects of your project. All classes in yourproject are displayed on a single page and highlighted to inform you about project risksor potential coverage improvements. Read More.

    Method-level Metrics

    Metrics at the method level are displayed both inline and in each class summary section.

    Linked, cross-referenced Reports

    Reports produced with the same task are automatically linked to each other. Source codeis cross-referenced for easy traversal between classes and up and down packagehierarchies.

    Sortable ColumnsAll tables in Clover 2 are client side sortable.

    Inline Help

    Help tooltips can be turned on for each page to describe metrics and controls.

    Streamlined Ant integration and simplified Ant tasks

    The new and tasks provide sensible defaults tothe existing clover-report task. The Clover initstring is now optional. If not specified,Clover2 will automatically create and manage the coverage database for you.

    Clover 2.0a5 User Manual

    Page 7Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    8/100

    2. Code Coverage

    2.1. Code Coverage

    2.1.1. What is Code Coverage?

    Code coverage measurement simply determines those statements in a body of code have beenexecuted through a test run and those which have not. In general, a code coverage systemcollects information about the running program and then combines that with sourceinformation to generate a report on test suite's code coverage.

    Code coverage is part of a feedback loop in the development process. As tests are developed,

    code coverage highlights aspects of the code which may not be adequately tested and whichrequire additional testing. This loop will continue until coverage meets some specified target.

    2.1.2. Why Measure Code Coverage?

    It is well understood that unit testing improves the quality and predictability of your softwarereleases. Do you know, however, how well your unit tests actually test your code? Howmany tests are enough? Do you need more tests? These are the questions code coveragemeasurement seeks to answer.

    Coverage measurement also helps to avoid test entropy. As your code goes through multiplerelease cycles, there can be a tendency for unit tests to atrophy. As new code is added, it may

    not meet the same testing standards you put in place when the project was first released.Measuring code coverage can keep your testing up to the standards you require. You can beconfident that when you go into production there will be minimal problems because youknow the code not only passes its tests but that it is well tested.

    In summary, we measure code coverage for the following reasons:

    To know how well our tests actually test our code To know whether we have enough testing in place To maintain the test quality over the lifecycle of a project

    Code coverage is not a panacea. Coverage generally follows an 80-20 rule. Increasingcoverage values becomes difficult with new tests delivering less and less incrementally. Ifyou follow defensive programming principles where failure conditions are often checked at

    many levels in your software, some code can be very difficult to reach with practical levelsof testing. Coverage measurement is not a replacement for good code review and goodprogramming practices.

    Clover 2.0a5 User Manual

    Page 8Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    9/100

    In general you should adopt a sensible coverage target and aim for even coverage across all

    of the modules that make up your code. Relying on a single overall coverage figure can hidelarge gaps in coverage.

    2.1.3. How Code Coverage Works

    There are many approaches to code coverage measurement. Broadly there are threeapproaches, which may be used in combination:

    Source Code Instrumentation This approach adds instrumentation statementsto the source code and compiles the code withthe normal compile tool chain to produce aninstrumented assembly.

    Intermediate code Instrumentation Here the compiled class files are instrumentedby adding new bytecodes and a newinstrumented class generated.

    Runtime Information collection This approach collects information from theruntime environment as the code executes todetermine coverage information

    Clover uses source code instrumentation, because although it requires developers to performan instrumented build, source code instrumentation produces the most accurate coveragemeasurement for the least runtime performance overhead.

    As the code under test executes, code coverage systems collect information about whichstatements have been executed. This information is then used as the basis of reports. In

    addition to these basic mechanisms, coverage approaches vary on what forms of coverageinformation they collect. There are many forms of coverage beyond basic statement coverageincluding conditional coverage, method entry and path coverage.

    2.1.4. Code Coverage with Clover

    Clover is designed to measure code coverage in a way that fits seamlessly with your currentdevelopment environment and practices, whatever they may be. Clover's IDE Pluginsprovide developers with a way to quickly measure code coverage without having to leave theIDE. Clover's Ant and Maven integrations allow coverage measurement to be performed inAutomated Build and Continuous Integration systems and reports generated to be shared bythe team.

    Types of Coverage measured

    Clover measures three basic types of coverage analysis:

    Clover 2.0a5 User Manual

    Page 9Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    10/100

    Statement Statement coverage measures whether eachstatement is executed

    Branch Branch coverage (sometimes called DecisionCoverage) measures which possible branches inflow control structures are followed. Clover doesthis by recording if the boolean expression inthe control structure evaluated to both true andfalse during execution.

    Method Method coverage measures if a method wasentered at all during execution.

    Clover uses these measurements to produce a Total Coverage Percentage for each class, file,package and for the project as a whole. The Total Coverage Percentage allows entities to be

    ranked in reports. The Total Coverage Percentage (TPC) is calculated as follows:

    TPC = (BT + BF + SC + MC)/(2*B + S + M)

    where

    BT - branches that evaluated to "true" at least onceBF - branches that evaluated to "false" at least onceSC - statements coveredMC - methods entered

    B - total number of branchesS - total number of statementsM - total number of methods

    Clover 2.0a5 User Manual

    Page 10Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    11/100

    3. Clover with Ant

    3.1. Quick Start Guide for Ant

    This section shows you how to quickly get Clover integrated into your build. Cloverinstrumentation and reporting are highly configurable so later sections of this manual willdetail available configuration options and typical usage scenarios.

    Follow these simple steps to integrate Clover with your build:

    3.1.1. Install Clover

    ensure you are using a recent version of Ant (v1.6.x or greater)

    unzip the Clover distribution into a directory. This directory will be referred to asCLOVER_HOMEin this guide.

    place your clover.license file in CLOVER_HOME/lib. (also see Installing your license file)

    3.1.2. Add Clover targets

    Edit build.xml for your project:

    1. add the Clover Ant tasks to your project:

    2. add a target to switch on Clover:

    3. add one or more targets to run clover reports:For html reporting, use (change the outdir to a directory path where Clover should putthe generated html and the testresultsdir to the location where your test results (xml)have been written):

    Note:

    Specify the testresultsdir to have your test results integrated with your Clover coverage report.

    Clover 2.0a5 User Manual

    Page 11Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    12/100

    - OR - for pdf reporting, use (change the outfile to a file where Clover should write thepdf file):

    - OR - for xml reporting, use (change the outfile to a file where Clover should write thexml file):

    - OR - for simple emacs-style reporting to the console, try:

    4. Add clover.jar to the runtime classpath for your tests. How you do this dependson how you run your tests. For tests executed via the task, add a classpathelement:

    ...

    3.1.3. Compile and run with Clover

    Now you can build your project with Clover turned on by adding the "with.clover" target tothe list of targets to execute. For example (if your compile target is named 'build' and yourunit test target is named 'test'):

    ant with.clover build test

    3.1.4. Generate a Coverage Report

    To generate a Clover coverage report:

    ant clover.html (or clover.xml, clover.view etc)

    Clover 2.0a5 User Manual

    Page 12Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    13/100

    3.2. Upgrading to Clover 2

    We've taken care to make the upgrade to Clover 2 straightforward. To upgrade to Clover 2,follow these simple steps

    1. Replace 1.x clover.jar with the 2.x clover.jarYou can do this by simply copying the new jar over the top of the old one.

    2. Obtain and install a Clover 2.x licenseOutput similar to the following will appear when Clover is run:

    [clover] Clover Version 2.X, built on ...[clover] Loaded from: c:/ant/lib/clover.jar

    3. Configure the Test Results Directory (optional)You can now optionally configure the Clover report tasks to include test result information inthe generated report. If you are using the task then add a fileset element. If you use the task, provide atestresultsdir attribute. This enables Clover 2 to display your Test Results and yourTest Coverage in the same report. Please read Test Result Integration for more information.

    4. Delete any existing Coverage database.The Clover database is created at the location specified in the initstring attribute of

    Note:

    In Clover 2, the initstring parameter is now optional. We recommend leaving it unspecified unless you want to explicitlycontrol where Clover writes it's database file.

    Please also read the Best Practices For Clover Integration.

    3.3. Install Options

    3.3.1. Installing Clover

    Note:

    Clover 2.x requires Ant 1.6.x or above.

    Adding Clover to your build is done by adding the following to your buildfile (e.g.build.xml) :

    Clover 2.0a5 User Manual

    Page 13Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    14/100

    Checking if Clover is available for the build

    In some cases you may want to check if Clover is available before executing Clover-relatedtargets. For example, you may need to ship the build file to others who may not have Cloverinstalled. To check Clover's availability you can make use of the standard Ant task:

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    15/100

    user's home directory. On Windows systems ${user.home} will map to something like C:\Documents andSettings\username\ . Check your JVM documentation for more details.

    Installing Clover at an arbitary location

    You can install and use Clover at an arbitary location and then refer to it using the -libcommand line option with Ant:

    ant -lib CLOVER_HOME/lib buildWithClover

    (Where CLOVER_HOME is the directory where Clover was installed).

    Installing Clover globally into Ant

    Copy clover.jar into ANT_HOME/lib (Since all jars in this directory are automaticallyadded to Ant's classpath by the scripts that start Ant).

    Alternatively, you can add CLOVER_HOME/clover.jar to the CLASSPATH systemenvironment variable before running Ant. For information about setting this variable, pleaseconsult your Operating System documentation.

    3.4. Best Practices for Clover Integration

    This section describes some recommended practices when integrating Clover into your Antbuild. For a great list of general Ant best practices, seehttp://www.onjava.com/pub/a/onjava/2003/12/17/ant_bestpractices.html

    1. Let Clover automatically choose the database locationIn Clover 1.x, the Clover database needed to be specified, via the initstring attributeon the task. Clover 2 makes the initstring attribute optional. Ifnot supplied, Clover will automatically create a special directory for the Clover coveragedatabase. There are several advantages in letting Clover use the default location. Clovertasks can find the database more easily, and build files become more portable. If left tothe default setting, there is no need to have Clover reporting targets depend on the theClover setup target.

    Note:

    If you want to specify the initstring explicity, it is strongly recommended that you give Clover it's own direct directory,because a Coverage run can result in many files being written to the database.

    2. Use the task

    Once you've generated the reports or history points you require from a Coverage run, use

    Clover 2.0a5 User Manual

    Page 15Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

    http://www.onjava.com/pub/a/onjava/2003/12/17/ant_bestpractices.htmlhttp://www.onjava.com/pub/a/onjava/2003/12/17/ant_bestpractices.html
  • 8/2/2019 Clover 2 Beta Version 2 0a5

    16/100

    to delete the database so that it will be freshly created for the nextbuild. This is easily achieved by adding the task to any existingclean target.

    3. Avoid setting the compiler or executable attributes on the task

    Setting either of these attributes makes your build less portable. It may also preventClover from installing correctly in your build.

    4. Set the source attribute on the task

    Setting the source attribute increases the portability of your build by explicitly definingthe language level of the project. If you don't set it, the language level is determined bywhatever underlying compiler is found by Ant.

    5. Use Target dependencies in preference to and

    Ant's target dependencies are an efficient way to manage build dependencies. You shouldalways strive to use this mechanism over the more "procedural" style of explicitly callingtargets. By explicitly calling Ant tasks, you miss out on Ant's powerful dependencymanagement where up-to-date targets are skipped. You also introduce significantmemory overhead (particularly if fork="true" is set). Excessive use ofcan also make a build file less readable, because it can be difficult to trace whichproperties and references are valid for a given target. Instead of:

    it is much better to use something like:

    6. If using the task, consider using fork="true" forkmode="once"

    Setting these attributes means that your JUnit tests will run in a single, separate JVM.This isolates the unit tests from the Ant JVM, and means that no special flushing isrequired to have Clover coverage data written to disk when the tests end.

    3.5. Usage Scenarios

    3.5.1. Using Clover Interactively

    In this scenario, a developer is responsible for obtaining a certain level of code coverage onher code before it is accepted into the base. The typical cycle the developer follows issomething like:

    Clover 2.0a5 User Manual

    Page 16Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    17/100

    1. write code/tests2. run tests3. inspect test results and code coverage

    This process is repeated until all tests pass and code coverage of the tests meets a certainlevel.

    Clover provides the following features to support this development pattern:

    Measuring coverage on a subset of source files Viewing source-level code coverage quickly Viewing summary coverage results quickly Incrementally building coverage results

    Measuring coverage on a subset of source files

    The task takes an optional nested fileset element that tells Clover which filesshould be included/excluded in coverage analysis:

    The includes could be set using an Ant property so that individual developers can specifyincludes on the command line:

    Developers can then use a command line like:

    ant build -Dcoverage.includes=**/foo/*.java

    Viewing source-level code coverage quickly

    Clover provides two ways of quickly viewing coverage results. The taskprovides quick reporting to the console:

    The output format from the clover-log task uses the file:line:column format that many IDEs

    can parse.

    Viewing summary coverage results quickly

    Clover 2.0a5 User Manual

    Page 17Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    18/100

    The task provides an option that will print a summary of coverage results to the

    console:

    Incrementally building coverage results

    When iteratively improving coverage on a subset of your project, you may want to includecoverage data from several iterations in coverage results. Clover supports this with the spanattribute which works on current reports - see Using Spans. This attribute can be used to tellClover how far back in time to include coverage results (measured from the time of the lastClover build). To include results gathered over the last hour use:

    3.5.2. Using Clover in Automated Builds

    In this scenario, the project is checked out, built and tested at regular intervals, usually by anautomated process. Some third party tools that support this type of build are AntHill,Centipede and CruiseControl.

    Clover supports this scenario with the following features:

    Detailed coverage reports for the whole team Executive summary coverage reports Historical coverage and project metrics reporting Coverage criteria checking and triggers

    Detailed coverage reports for the whole team

    Note:

    The and the tasks used here are simplified versions of the task. Ifyou require more control over your report formatting and structure, then use the task.

    The task generates source-level html coverage reports that can bepublished for viewing by the whole team:

    Executive summary coverage reports

    The task can generate summary reports in PDF suitable for email or

    Clover 2.0a5 User Manual

    Page 18Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

    http://krysalis.org/centipede/http://cruisecontrol.sourceforge.net/http://cruisecontrol.sourceforge.net/http://krysalis.org/centipede/http://www.urbancode.com/projects/anthill/default.jsp
  • 8/2/2019 Clover 2 Beta Version 2 0a5

    19/100

    audit purposes.

    Historical coverage and project metrics reporting

    Clover can generate a historical snapshot of coverage and other metrics for your project usingthe task. Historical data can then be colated into a historical reportusing the task:

    Coverage criteria checking and triggers

    The task can be used to monitor coverage criteria. If coverage does not meetthe criteria, the build can be made to fail or an arbitary activity can be triggered. In theexample below, if project coverage is not 80%, an executive summary coverage report isgenerated and mailed to the team:

    3.6. Ant Task Reference

    Clover 2.0a5 User Manual

    Page 19Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    20/100

    3.6.1. Clover Ant Tasks

    Installing the Ant Tasks

    Clover provides a set of Ant tasks to make project integration easy. To make these tasksavailable in your project build file, you need to:

    load the 'cloverlib.xml' antlib by adding the following line to your build file:

    Make sure you change the above "/path/to/clover.jar" to point directly to yourclover.jar.

    For further options, see also Ant Installation Options.

    The tasks

    Installs Clover as the Ant build.compiler.This means that Clover will be invokedwhenever the Ant is used, resulting ininstrumented compilation.

    Produces coverage reports in different formats.

    Tests project/package code coverage againstcriteria, optionally failing the build if the criteriaare not met.

    Reports coverage results to the console atvarious levels.

    Allows manual instrumentation of source files,for cases where the normal integration approach can't be used.

    Records a coverage history point for use inhistorical coverage reports.

    Delete the coverage database and/or associatedcoverage records.

    Generates a HTML report with default settings.

    Generates a PDF report with default settings.

    3.6.2.

    Clover 2.0a5 User Manual

    Page 20Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    21/100

    Description

    The task initialises Clover for use with your project. In Clover 1.0, Clover'soperation was managed by setting various Ant properties. The task simplifiesthis procedure.

    Parameters

    Attribute Description Required

    initstring The Clover initString describesthe location of the clovercoverage database. Typicallythis is a relative or absolute file

    reference. e.g.${basedir}/build/clover.db

    If not specified it defaults to.clover, relative to theproject's base directory.

    No

    enabled This controls whether Cloverwill instrument code duringcode compilation. This attributeprovides a convenient controlpoint to enable or disableClover from the command line

    No; defaults to true

    clovercompiler After instrumentation, Clover

    hands off compilation to thestandard Ant compiler adapter(or the compiler specified bythe build.compiler Antproperty). This attributespecifies the adapter to use. Ittakes the same values as thestandard Ant build.compilerproperty. If you wish to specifyan alternative compiler, youcan either set thebuild.compiler property or usethis attribute.

    No

    preserve A boolean attribute whichcontrols whether theinstrumented source will beretained after compilation.

    No; defaults to false

    Clover 2.0a5 User Manual

    Page 21Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    22/100

    source The default source level toprocess source files at. Notethat setting the source attributeon the target willoverride this setting.

    No

    tmpdir The directory into which Cloverwill write an instrumented copyof the source code.

    No

    flushpolicy This attribute controls howClover flushes coverage dataduring a test run. Valid valuesare directed, interval, orthreaded.

    directedCoverage data is flushed atJVM shutdown, and afteran inline flush directive.intervalCoverage data is flushedas for directed, as wellas periodically at amaximum rate based onthe value offlushinterval. This is a"passive" mode in thatflushing potentially occursas long as instrumented

    code is being executed.threadedCoverage data is flushedas for directed, as wellas periodically at a ratebased on the value offlushinterval. This isan "active" mode in thatflushing occurs on aseparate thread and is notdependent on theexecution of instrumentedcode.

    For more information, see FlushPolicies.

    No; defaults to directed

    flushinterval When the flushpolicy is set tointerval or threaded this

    No

    Clover 2.0a5 User Manual

    Page 22Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    23/100

    value is the minimum periodbetween flush operations (inmilliseconds)

    relative This controls whether theinitstring parameter is treatedas a relative path or not.

    No; defaults to false

    It is important to note that the Clover compiler adapter still picks up its settings from the setof Clover Ant properties. The task provides a convenience method to setthese properties. This means that builds that use the Clover 1.0 property set will continue tooperate as expected.

    Note:

    Do not set the "compiler" attribute on the task as this overrides the Clover compiler setup by . Use the"clovercompiler" attribute instead.

    Nested Elements of

    An Ant patternset element which controls which files are included or excluded from Cloverinstrumentation.

    Note:

    The sub-element has been deprecated and has no effect.

    As of Clover 1.2, also supports multiple Ant . These give greaterflexibility in specifying which source files are to be instrumented by Clover. This is usefulwhen you have more than one source base and only want some of those source bases to beinstrumented. This can be difficult to setup with patterns. Filesets also allow much greaterflexibility in specifying which files to instrument by facilitating the use of Ant's filesetselectors.

    Specifies a method Context definition. See Using Contexts for more information.

    Parameters

    Clover 2.0a5 User Manual

    Page 23Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    24/100

    Attribute Description Required

    name The name for this context. Mustbe unique, and not be one ofthe reserved context names(See Using Contexts)

    Yes

    regexp A Perl 5 Regexp that definesthe context. This regexp shouldmatch the method signatures ofmethods you wish to include inthis context. Note that whenmethod signatures are testedagainst this regexp, whitespaceis normalised and commentsare ignored.

    yes

    Specifies a statement Context definition. See Using Contexts for more information.

    Parameters

    Attribute Description Required

    name The name for this context. Mustbe unique, and not be one ofthe reserved context names(See Using Contexts)

    Yes

    regexp A Perl 5 Regexp that definesthe context. This regexp shouldmatch statements you wish toinclude in this context. Notethat when statements aretested against this regexp,whitespace is normalised andcomments are ignored.

    yes

    Examples

    This example is the minimal setup to use clover. In this case the clover coverage database islocated in the .clover relative directory.

    Clover 2.0a5 User Manual

    Page 24Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    25/100

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    26/100

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    27/100

    projectName Overrides the project name setin the Ant build file. This is usedfor display purposes only.

    No; defaults to the projectname of the Ant build file.

    Nested elements of

    These elements represent the actual reports to be generated. You can generate multiplereports by specifying more than one of these inside a element. Each reportwill contain links to the other reports. See example.

    Generates a current coverage report. Specify the report format using a nested Formatelement. Valid formats are XML, HTML, and PDF although not all configurations supportall formats. The default format is PDF if summary="true" or XML if not. See Current Reportexamples.

    Parameters

    Attribute Description Required

    title Specifies a title for the report. No

    titleAnchor if specified, the report title willbe rendered as a hyperlink tothis href.

    No; default is to not render thereport title as a hyperlink.

    titleTarget Specifies the href target if thetitle is to be rendered as ahyperlink (see titleAnchorabove). HTML format only

    No; default is "_top"

    alwaysReport If set to true, a report will begenerated even in the absenceof coverage data.

    No; defaults to "false"

    outfile The outfile to write output to. Ifit does not exist, it is created.Depending on the specifiedformat, this either represents aregular file (PDF, XML) or a

    directory (HTML).

    Yes

    summary Specifies whether to generate asummary report or detailedreport.

    No; Defaults to "false".

    Clover 2.0a5 User Manual

    Page 27Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    28/100

    package Restricts the report to aparticular package.

    No

    span Specifies how far back in timeto include coverage recordingsfrom since the last Clover build.See Using Spans.

    No; Defaults to "0s".

    maxTestsPerFile Specifies the maximum numberof tests (ranked by coveragecontribution) to display on asource file report page. Thisparameter can be used toreduce the size of reports forprojects with very largenumbers of tests.

    No; unlimited if not specified or-1

    homepage Specifies the start page to use.This can be one of thepredefined pages:dashboard, overview,

    aggregate, testresults,

    quickwins, projectrisks

    or an arbitrary URL.

    No; defaults to "dashboard".

    Generates a historical coverage report. Specify the report format using a nested Formatelement. Valid formats are HTML or PDF. The default format is PDF. Contents of thehistorical report are optionally controlled by nested elements. See Nested elements ofHistorical.

    Parameters

    Attribute Description Required

    title Specifies a title for the report. No

    titleAnchor if specified, the report title willbe rendered as a hyperlink tothis href.

    No; default is to not render thereport title as a hyperlink.

    titleTarget Specifies the href target if thetitle is to be rendered as ahyperlink (see titleAnchorabove). HTML format only

    No; default is "_top"

    Clover 2.0a5 User Manual

    Page 28Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    29/100

    outfile The outfile to write output to. Ifit does not exist, it is created.Depending on the specifiedformat, this either represents aregular file (PDF) or a directory(HTML).

    Yes

    historyDir The directory containing Cloverhistorical data as produced bythe task.

    Yes

    package Restricts the report to aparticular package.

    No

    from Specifies the date before whichdata points will be ignored. The

    date must be specified eitherusing the default

    java.text.SimpleDateFormat foryour locale or using the patterndefined in the "dateFormat"attribute.

    No

    to Specifies the date after whichdata points will be ignored. Thedate must be specified eitherusing the default

    java.text.SimpleDateFormat foryour locale or using the patterndefined in the "dateFormat"attribute.

    No

    dateFormat Specifies a date format stringfor parsing the "from" and "to"fields. The string must containa valid

    java.text.SimpleDateFormatpattern.

    No; default set tojava.text.SimpleDateFormatusing the default pattern anddate format symbols for thedefault locale.

    Nested elements of

    supports nested filesets which control which source files are to be included in areport. Only classes which are from the source files in the fileset are included in the report.This allows reports to focus on certain packages or particular classes. By using Ant's fileset

    Clover 2.0a5 User Manual

    Page 29Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    30/100

    selectors, more complicated selections are possible, such as the files which have recently

    changed, or files written by a particular author.

    Specifies a Ant path that Clover should use when looking for source files.

    Nested elements of

    These elements represent individual sections of the historical report. If you do not specifyany of these elements, all the sections will be included in the report. If you specify more oneor more of these elements, only the specified sections will be included. You may specifymultiple and elements in the historical report. These may have

    different properties and include different elements. The charts will appear in the report in thesame order they appear in the element. The element always appears atthe end of the report following these charts regardless of its location in the element. element.

    Specifies a section that provides summary of the total percentage coverage at the last historypoint. This element does not support any attributes.

    Specifies a chart showing percentage coverage over time.

    Parameters

    Attribute Description Required

    include A comma or space separatedlist of coverage metrics toinclude in the chart. Validvalues are: branches,statements, methods,

    total

    No; the default is thateverything is included

    Specifies a chart showing other metrics over time.

    Clover 2.0a5 User Manual

    Page 30Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    31/100

    Parameters

    Attribute Description Required

    include A comma or space separatedlist of metrics to include in thechart. Valid values are: loc,ncloc, statements,

    methods, classes,

    files, packages

    No; defaults to loc, ncloc,methods, classes

    logscale Specifies that a log scale beused on the Range Axis. Thiscan be useful if you areincluding, say LOC and

    packages in the same chart.

    No; default is "true"

    Specifies a table that shows those classes that have a coverage delta higher than a specifiedthreshold over a specified time preiod.

    Parameters

    Attribute Description Required

    threshold The absolute point change inpercent coverage that class

    must have changed by forinclusion. e.g "10%".

    No; defaults to 1%

    range The maximum number ofclasses to show. If the value is5, then a maximum of 5"gainers" and 5 "losers" will beshown.

    No; The defaults to 5

    interval The time interval over whichthe delta should be calculated(from the last history point).Uses the Interval format. Therange is automatically adjusted

    to the closest smaller intervalavailable.

    No; The default is to take thedelta of the last two historypoints

    The Element

    Clover 2.0a5 User Manual

    Page 31Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    32/100

    Specifies the output format and various options controlling the rendering of a report.

    Parameters

    Attribute Description Required

    type The output format to render thereport in. Valid values are pdf,xml, html. Note that not allreports support all formats.

    Yes, unless refid is set

    refid the id of another formatelement that will be used forthis report. See Sharing ReportFormats.

    No

    id the id of this format element. No

    bw Specify that the report shouldbe black and white. This willmake HTML reports smaller(with no syntax highlighting)and make PDF reports suitablefor printing on a non-colourprinter.

    No; defaults to "false"

    orderBy Specify how to order coveragetables. This attribute has noeffect on XML format. Valid

    values are:AlphaAlpabetical.PcCoveredAscPercent total coverage,ascending.PcCoveredDescPercent total coverage,descending.ElementsCoveredAscTotal elements covered,ascendingElementsCoveredDescTotal elements covered,

    descendingElementsUncoveredAscTotal elements uncovered,ascendingElementsUncoveredDesc

    No; defaults to PcCoveredAsc

    Clover 2.0a5 User Manual

    Page 32Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    33/100

    Total elements uncovered,descending

    noCache (HTML only) if true, insertnocache directives in htmloutput.

    No; defaults to "false"

    srcLevel if true, include source-levelcoverage information in thereport.

    No; defaults to "true"

    filter comma or space separated listof contexts to exclude whengenerating coverage reports.See Using Contexts.

    No

    pageSize (PDF only) Specify the pagesize to use. Valid values areA4, LETTER

    No; defaults to "A4"

    showEmpty If true, classes, files andpackages that do not containany executable code (i.e.methods, statements, orbranches) are included inreports. These are normally notshown.

    No; defaults to "false"

    tabWidth (Source level reports only) Thenumber of space chars to

    replace TAB characters with.

    No; defaults to 4

    maxNameLength The maximum length in charsof package or classnames inthe report. Longer names willbe truncated. A value < 0indicates no limit.

    No; defaults to no limit

    The Element

    Specifies the data columns to be included on summary pages. If not specified, defaultcolumns will be output.Specific columns are defined as sub-elements to this one. See example

    Each column element takes an optional format attribute which determines how thecolumn's value is rendered. The format attribute may be one of the following:

    raw - the actual value. Always used for total columns

    Clover 2.0a5 User Manual

    Page 33Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    34/100

    bar - render a bar chart (200px wide) showing the coverage percentage shortbar - same as bar above, but only 40px wide % - The coverage percentage value

    bar and % are not valid formats for total columns.

    All column elements also take max and/or min threshold attributes. If the value for thecolumn is outside the threshold the value will be highlighted.

    Column Names

    Column Description Valid Format Attributes

    totalPercentageCovered The total coverage. raw;bar;%;shortbar

    totalElements The total number of elements(branches + statements) in theproject.

    raw

    coveredElements The total number of coveredelements (branches +statements) in the project.

    raw;bar;%;shortbar

    totalBranches The total number of branchesin the project.

    raw

    coveredBranches The amount of coveredbranches.

    raw;bar;%;shortbar

    totalStatements The total number of statements

    in the project.

    raw

    coveredStatements The amount of coveredstatements.

    raw;bar;%;shortbar

    totalMethods The total number of methods inthe project.

    raw

    coveredMethods The amount of coveredmethods.

    raw;bar;%;shortbar

    totalChildren The number of lower orderelements. The order ofelements is: Project, Package,

    File, Class, Method, Statement

    raw

    complexity Cyclomatic Complexity is ameasure of the number ofpaths in your code.

    raw

    Clover 2.0a5 User Manual

    Page 34Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    35/100

    avgMethodComplexity The average number of pathsper method.

    raw

    complexityDensity The average complexity perstatement.

    raw

    avgClassesPerFile The average number of classesper file.

    raw

    avgMethodsPerClass The a verage n umber ofmethods per class.

    raw

    avgStatementsPerMethod The average number ofstatements per method.

    raw

    totalFiles The total number of files below

    the package or project.

    raw

    totalClasses The total number of classesbelow the package, project orfile.

    raw

    lineCount The total number of lines. raw

    ncLineCount The total number ofnon-comment lines.

    raw

    Column Attributes

    Each of the above column elements can take the following attributes:

    Attribute Description Required

    format Determines how the value isrendered. Depending on thecolumn, this may be one ofraw, bar, % or shortbar.

    No

    min Sets a minimum threshold onthe value of the column. If thevalue is less than this it will behighlighted.

    No

    max Sets a maximum threshold on

    the value of the column. If thevalue is greater than this it willbe highlighted.

    No

    Clover 2.0a5 User Manual

    Page 35Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    36/100

    The fileset element

    is an Ant fileset that Clover uses to integrate the results of your unit tests intothe report. The results should be generated using the Ant junit task with an xml formatter.

    The fileset element

    is an Ant fileset that can be used to distinguish test source code fromapplication source code. All files included in the fileset will be displayed in the separate'Test' node of the coverage tree. If omitted, Clover's default test detection algorithm will beused to distinguish test sources.

    Examples of Current Report Configurations

    Generates an XML report of the current coverage.

    Generates a PDF report of the current coverage.

    Generates a summary report, in HTML with a custom title. Note, the "outfile" argumentrequires a directory instead of a filename.

    Generates a detailed coverage report in HTML with output ordered by total number ofcovered elements, rather than percentage coverage. All source files under src/test will be

    Clover 2.0a5 User Manual

    Page 36Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

    http://ant.apache.org/manual/CoreTypes/fileset.htmlhttp://ant.apache.org/manual/OptionalTasks/junit.htmlhttp://ant.apache.org/manual/CoreTypes/fileset.htmlhttp://ant.apache.org/manual/CoreTypes/fileset.htmlhttp://ant.apache.org/manual/OptionalTasks/junit.htmlhttp://ant.apache.org/manual/CoreTypes/fileset.html
  • 8/2/2019 Clover 2 Beta Version 2 0a5

    37/100

    in the separate 'Test' coverage node in the report.

    Generates a sourcelevel report in HTML. Clover will search for source files in the directory/some/other/location.

    This example generates a current coverage report for all files in the project that have changedin the last month. Replacing the selector with would generate a coverage report for all code where John Doe is the author.

    In this example the standard Clover patternset is used to restrict the report to the currentlyincluded source files. You could use this if you have changed the exclude or includedefinitions in the task and you have not removed the coverage database. It

    will prevent classes, currently in the database but now excluded, from being included in thereport. It is prudent, however, to delete the coverage databse, coverage information andrecompile when you change these settings.

    Clover 2.0a5 User Manual

    Page 37Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    38/100

    Customising Columns

    Generates a HTML report, that will only include a bar chart showing the percentage of

    methods covered, the actual percentage of statements covered and the actual number ofbranches covered. If less than 75% of methods are covered, those values will be highlighted.

    Linked Report Example

    Generates two HTML reports. Both of these reports will contain a link to the other.

    Examples of Historical Report Configurations

    Generates a historical report in PDF. Assumes that has generated more

    Clover 2.0a5 User Manual

    Page 38Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    39/100

    than one history file in the directory "clover_history". Writes the output to the file specified

    in the outfile parameter.

    Generates a basic historical report in HTML for a certain time period. Clover will scan thehistory dir and use any history points that fall within the requested time period. The outfileattribute will be treated as a directory; a file historical.html will be written into thisdirectory. If the directory doesn't exist, it will be created.

    Generates a PDF historical report that only includes an overview section (showing summarycoverage at the last history point) and a movers table showing classes that have a codecoverage delta of greater than +- 5% over the two weeks prior to the last history point. Willinclude at most 20 gainers and 20 losers.

    3.6.4.

    Description

    Generates a full HTML report with sensible default settings. If configured, a history point isalso generated prior to generation of the full report. For more configuration options, use the task.

    Parameters

    Attribute Description Required

    outdir The directory to write the reportto.

    Yes.

    initstring The path to the Cloverdatabase. If not specified,Clover will use the initstring set

    No.

    Clover 2.0a5 User Manual

    Page 39Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    40/100

    by a previous execution of in the currentbuild sequence. Otherwise, thedefault database location willbe used.

    title The title to use in the report. No.

    testresultsdir The directory containing theXML results of the unit tests.Clover will look for allTEST*.xml files in thisdirectory.

    No.

    historydir The directory for Clover historypoints. If this attribute is set,a new history point will begenerated prior to thegeneration of the full report.For more information, see.

    No.

    Examples

    This is the simplest way to generate a html report. It will be written to the directory"clover/report".

    This will generate a report in the "build/clover/report" directory. A history point will becreated in the "clover/historypoints" directory, and all history points in that directory will beused to generate the historical section of the report. The report will be titled "MyProjectCoverage". Test results will be loaded from "build/test/results"

    3.6.5.

    Description

    Generates a PDF report with sensible default settings. If configured, a history point is alsogenerated prior to generation of the full report. For more configuration options, use the task.

    Clover 2.0a5 User Manual

    Page 40Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    41/100

    Parameters

    Attribute Description Required

    outfile The filename to write the reportto

    Yes.

    initstring The path to the Cloverdatabase. If not specified,Clover will use the initstring setby a previous execution of in the currentbuild sequence. Otherwise, thedefault database location willbe used.

    No.

    historydir The directory that contains anyclover history points. If thisattribute is set, a new historypoint will be generated priorto the generation of the fullreport. For more information,see .

    No.

    title The title to use in the report. No.

    Examples

    This is the simplest way to generate a pdf report. It will be written to the file"clover_coverage.pdf".

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    42/100

    Attribute Description Required

    historyDir The directory where historicaldata is stored.

    Yes

    initstring The initstring of the coveragedatabase.

    No; If not specified here, Cloverwill look in the default location(${basedir}/.clover). If you havespecified an initstring on the task you mustensure is calledprior the execution of this task.

    date Specifies an override date forthis history point. This allowsfor generation of past historical

    data for a project.

    No; defaults to the timestampof the current coverage data.

    dateFormat Specifies a date format stringfor parsing the "date" attribute.The string must contain a valid

    java.text.SimpleDateFormatpattern.

    No; default set tojava.text.SimpleDateFormatusing the default pattern anddate format symbols for thedefault locale.

    filter comma or space separated listof contexts to exclude whengenerating the historypoint.See Using Contexts.

    No

    span Specifies how far back in time

    to include coverage recordingsfrom since the last Clover build.See Using Spans.

    No; Defaults to "0s".

    overwrite If true, existing history point forthe same date will beautomatically overwritten.

    No; Defaults to "false".

    Nested elements of

    supports nested filesets which control which source files are to beincluded in a historypoint. Only classes which are from the source files in the fileset areincluded in the historypoint. This allows historypoints to focus on certain packages orparticular classes. By using Ant's fileset selectors, more complicated selections are possible,such as the files which have recently changed, or files written by a particular author.

    Clover 2.0a5 User Manual

    Page 42Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    43/100

    is an Ant fileset that can be used to distinguish test source code fromapplication source code. All files included in the fileset will be displayed in the separate'Test' node of the coverage tree. If omitted, Clover's default test detection algorithm will beused to distinguish test sources.

    Examples

    Records a history point into the directory PROJECT_DIR/clover-historical

    Records a history point, with the effective date of 24/07/01 12:08:56

    3.6.7.

    Description

    Tests project/package code coverage against criteria, optionally failing the build if the criteriaare not met. This task needs to be run after coverage has been recorded.

    ParametersAttribute Description Required

    target The target percentage totalcoverage for the project. e.g."10%"

    At least one of these, unlessnested elementsare specified.

    methodTarget The target percentage methodcoverage for the project.

    statementTarget The target percentagestatement coverage for theproject.

    conditionalTarget The target percentageconditional coverage for theproject.

    initstring The initstring of the coverage No; If not specified here, Clover

    Clover 2.0a5 User Manual

    Page 43Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

    http://ant.apache.org/manual/CoreTypes/fileset.htmlhttp://ant.apache.org/manual/CoreTypes/fileset.html
  • 8/2/2019 Clover 2 Beta Version 2 0a5

    44/100

    database. will look in the default location(${basedir}/.clover). If you havespecified an initstring on the task you mustensure is calledprior the execution of this task.

    haltOnFailure Specifies if the build should behalted if the target is not met.

    No; default is "false"

    failureProperty Specifies the name of aproperty to be set if the target isnot met. If the target is not met,the property will contain a textdescription of the failure(s).

    No

    filter comma or space separated listof contexts to exclude whencalculating coverage. SeeUsing Contexts.

    No

    span Specifies how far back in timeto include coverage recordingsfrom since the last Clover build.See Using Spans.

    No; Defaults to "0s".

    Nested elements of

    Specifies a target for a named package.

    Parameters

    Attribute Description Required

    name The name of the package. exactly one of these

    regex Regular expression to matchpackage names.

    Clover 2.0a5 User Manual

    Page 44Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    45/100

    target The target percentage totalcoverage for the package. e.g."10%"

    At least one of these.

    methodTarget The target percentage methodcoverage for the package.

    statementTarget The target percentagestatement coverage for thepackage.

    conditionalTarget The target percentageconditional coverage for thepackage.

    Examples

    Tests if total percentage coverage is at least 80%. If not, a message is logged and the buildcontinues.

    Tests if total percentage coverage is at least 80%. If not, a message is logged and the buildfails.

    Tests if total percentage coverage is at least 80%. If not, a message is logged and the projectproperty coverageFailed is set.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    46/100

    As above, but don't include coverage of catch blocks when measuring criteria.

    As previous example, but also ensure project conditional coverage is at least 90%.

    Tests if coverage for com.acme.killerapp.core and all subpackages is atleast 70%.

    3.6.8.

    Description

    Reports coverage information to the console at different levels.

    Parameters

    Attribute Description Required

    initstring The initstring of the coveragedatabase. No; If not specified here, Cloverwill use the default location(${basedir}/.clover). If you havespecified an initstring on the task you mustensure is calledprior the execution of this task.

    level Controls the level of detailincluded in the report. Validvalues are summary, class,method, statement

    No; defaults to "summary"

    filter comma or space separated list

    of contexts to ignore whencalculating coverage. SeeUsing Contexts.

    No

    span Specifies how far back in timeto include coverage recordings

    No; Defaults to "0s".

    Clover 2.0a5 User Manual

    Page 46Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    47/100

    from since the last Clover build.See Using Spans.

    Nested elements

    Specifies a named package to restrict the report to. Multiple elements can bespecified.

    Parameters

    Attribute Description Required

    name The name of the package toinclude.

    Yes

    Specifies a Ant path that Clover should use when looking for source files.

    Examples

    Prints a summary of code coverage to the console.

    Prints a summary of code coverage for the package com.acme.killerapp.core to theconsole.

    Prints detailed (source-level) code coverage information for the packagecom.acme.killerapp.core to the console.

    Clover 2.0a5 User Manual

    Page 47Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    48/100

    As above, but catch blocks will not be considered in coverage reporting.

    Prints source-level coverage report to the console. Clover will look for source files in thedirectory /some/other/location.

    3.6.9.

    Description

    The task produces instrumented versions of sets of source files. These canthen be compiled in place of the original source to produce an instrumented build. The task is provided for users that can't make use of the standard integration task. The task offers a simpler and lessintrusive integration option for most users.

    Parameters

    Attribute Description Required

    initstring The Clover initString describesthe location of the clover

    coverage database. Typicallythis is a relative or absolute filereference. e.g.${basedir}/build/clover.db

    If not specified it defaults to.clover, relative to theproject's base directory.

    No

    source The source level to processsource files at. It isrecommended that you setthis parameter, either here oron invocations.

    No; defaults to Java versiondetected at runtime.

    destdir The directory into which Cloverwill write an instrumented copyof the source code.

    Yes

    srcdir The directory of source code toinstrument.

    Yes, unless a nested element is used.

    Clover 2.0a5 User Manual

    Page 48Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    49/100

    flushpolicy This attribute controls howClover flushes coverage dataduring a test run. Valid valuesare directed, interval, orthreaded.

    directedCoverage data is flushed atJVM shutdown, and afteran inline flush directive.intervalCoverage data is flushedas for directed, as wellas periodically at amaximum rate based onthe value of

    flushinterval. This is a"passive" mode in thatflushing potentially occursas long as instrumentedcode is being executed.threadedCoverage data is flushedas for directed, as wellas periodically at a ratebased on the value offlushinterval. This isan "active" mode in thatflushing occurs on aseparate thread and is not

    dependent on theexecution of instrumentedcode.

    For more information, see FlushPolicies.

    No; defaults to directed

    flushinterval When the flushpolicy is set tointerval or threaded thisvalue is the minimum periodbetween flush operations (inmilliseconds)

    No

    relative This controls whether the

    initstring parameter is treatedas a relative path or not.

    No; defaults to false

    Nested Elements of

    Clover 2.0a5 User Manual

    Page 49Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    50/100

    Specifies a set of source files to instrument.

    Specifies a method Context definition. See Using Contexts for more information.

    Parameters

    Attribute Description Required

    name The name for this context. Mustbe unique, and not be one of

    the reserved context names(See Using Contexts)

    Yes

    regexp A Perl 5 Regexp that definesthe context. This regexp shouldmatch the method signatures ofmethods you wish to include inthis context. Note that whenmethod signatures are testedagainst this regexp, whitespaceis normalised and commentsare ignored.

    yes

    Specifies a statement Context definition. See Using Contexts for more information.

    Parameters

    Attribute Description Required

    name The name for this context. Mustbe unique, and not be one ofthe reserved context names(See Using Contexts)

    Yes

    regexp A Perl 5 Regexp that defines

    the context. This regexp shouldmatch statements you wish toinclude in this context. Notethat when statements aretested against this regexp,

    yes

    Clover 2.0a5 User Manual

    Page 50Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    51/100

    whitespace is normalised andcomments are ignored.

    Examples

    Produce an instrumented copy of all source files in the src dir into the destdir. TheClover registry is at the default location.

    This example achieves the same as the first example, but using an embedded fileset.

    Interval Flushing

    By default Clover will write coverage data to disk when the hosting JVM exits, via ashutdown hook. This is not always practical, particularly when the application you are testingruns in an Application Server. In this situation, you can configure Clover to use "interval"flushing, where coverage data is written out periodically during execution:

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    52/100

    Parameters

    Attribute Description Required

    initstring The initstring of the database toclean.

    No; If not specified here, Cloverwill use the default location(${basedir}/.clover). If you havespecified an initstring on the task you mustensure is calledprior the execution of this task.

    keepdb Keep the coverage databasefile. If "false", the coveragedatabase will be deleted.

    ("true"/"false").

    No; defaults to "true"

    verbose Show the name of each deletedfile ("true"/"false").

    No; defaults to "false"

    haltOnError Controls whether an error (suchas a failure to delete a file)stops the build or is merelyreported to the screen("true"/"false").

    No; defaults to "false"

    Examples

    Deletes all of the coverage recordings.

    Deletes all of the coverage recordings, printing out a log statement for each file deleted.

    Deletes the coverage database and all of the coverage recordings.

    3.7. Unit Test Results and Per-test Coverage

    Clover 2 introduces the ability to integrate Unit Test results and per-test coverageinformation into Coverage reports. This unique feature gives you a powerful insight into howwell tested your covered code actually is, by showing you exactly which statements each ofyour tests cover.

    Clover 2.0a5 User Manual

    Page 52Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    53/100

    To take advantage of this feature, follow these steps:

    1. Allow Clover to instrument your test classes.This allows Clover to specially mark test methods to enable per-test coverage reporting.The Clover instrumenter automatically detects test methods for Junit 3.x, Junit 4.x andTestNG.

    2. Enable XML reports from your Unit Test execution.This allows Clover to integrate Unit Test results into Coverage reports. In an Ant build, ifusing the task, you need to add an XML result formatter:

    ...

    ...

    3. Tell the Clover report task(s) how to find the XML test reports.If you are using the

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    54/100

    formats elements are not compatible with Ant 1.4.1. You require at least Ant 1.5.1 touse this feature. These standalone types support the same attributes and elements as theinternal elements of the task. You name the format usingthe standard Ant "id" attribute.

    The following code declares two report formats

    In this example, the first format is for source level, PDF reports. It is named "std.format".The second format, "bw.format", is essentially the same except it specifies black and whiteoutput.

    Once the format is declared with an identifier, it can be used by reference with a "refid"

    attribute. This is shown in the following report example

    This report, a summary report, uses the "std.format" format defined above. The refid valuesin the elements can be an Ant property allowing selection of the report format atbuild time. The following is a complete example

    Here, we are generating two reports, which share a format. The format defaults to the

    standard format, a colour report. This default can be overriden from the command line. Togenerate black and white reports you would use:

    ant report -Dformat=bw.format

    Clover 2.0a5 User Manual

    Page 54Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    55/100

    4. IDE Plugin Guides

    4.1. Clover IDE Plugins

    Clover provides fully integrated plugins for many popular Integrated DevelopmentEnvironments. The plugins allow you to measure and view code coverage without leavingthe IDE. They are also compatible Clover for Ant.

    4.1.1. Plugin Guides

    Eclipse IntelliJ IDEA: coming soon

    NetBeans: coming soon

    4.2. Eclipse Plugin Guide

    Plugin Version 2.0.0.a1 (alpha 1)

    Note:

    This is an Early Access Programme (EAP) alpha release of the plugin based on a complete rewrite of the software. Somefunctionality from previous versions of the plugin is not yet available and it's likely there are bugs in the functionality that isprovided. Additionally, once you've upgraded your project to use this new version of Clover it is non-trivial todowngrade.For these reasons, we do not recommend you use this plugin for the development of production code in your main Eclipseinstallation and urge you to routinely back up / check in the source code of your Eclipse projects while using this alphasofware.This plugin has been tested with Eclipse 3.2; using JDKs 1.4.x, and JDKs 1.5.x.

    We have not tested the plugin with Eclipse 3.3 milestone releases nor Rational Application Developer for WebSphere Softwarev7.0 (based on Eclipse 3.2) at this stage.

    4.2.1. Overview

    The Clover Eclipse Plugin allows you to instrument your Java code easily from within theEclipse Java IDE, and to view your coverage results inside Eclipse.

    4.2.2. Limitations

    For existing Clover 1.x users, there are a number of features missing from this EAP release:

    Context filters. Ant path filters. Working sets. Coverage markers.

    Clover 2.0a5 User Manual

    Page 55Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

    http://www.eclipse.org/http://www.eclipse.org/
  • 8/2/2019 Clover 2 Beta Version 2 0a5

    56/100

    Project properties.

    All these features will be added back in to Clover 2.x over the course of the EAP.Know issues:

    Enabling / disabling Clover compilation. Sometimes enabling / disabling compilationwith Clover on a project will require you to manually perform a clean build to restoreyour project to a fully instrumented / uninstrumented state. If in doubt, perform a cleanbuild.

    Hidden .clover_ projects. To perform the source code instrumentation required for codecoverage analysis, Clover needs to create and control a hidden Eclipse project in yourworkspace for each of your Clover-enabled projects. The name of this project is.clover_YourProjectName and although we've hidden its presence from many Eclipse UIelements there are still some places where you may see it. Please ignore resources from

    this project while we work on completely eliminating its presence from your workflow.

    4.2.3. Installation

    1 Installing the plugin

    Within Eclipse, select from the menu "Help | Software Updates | Find and Install" to startthe installation process.

    Select "Search for new features to install" and click the "Next" button to continue. Click the "New Remote Site" button and provide a name of "Clover EAP Update Site"

    and a URL of http://www.cenqua.com/clover/20/eap/eclipse/ ; click the "Finish" button.This will point Eclipse to the Clover EAP update site from where it will download the

    plugin. Select the entry "Clover EAP Update Site" (and all its children elements) and click the

    "Next" button to select the Clover plugin for installation. Accept the license agreement if you agree, click the "Next" button and then click "Finish"

    to start download process. You will then be prompted to confirm installation the Clover feature (Eclipse

    terminology for a collection of plugins). The Clover plugin is not yet digitally signed soyou may encounter a warning to this effect - please ignore this warning. Click "Install" toproceed with the installation.

    Finally, you will be asked if you want to restart Eclipse after installing the plugin. Click"Yes" to restart and activate the plugin.

    2 Installing the license

    The plugin comes with an EAP license embedded and already activated. During the EAPprogramme you will not need to modify this license.

    Clover 2.0a5 User Manual

    Page 56Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    57/100

    4.2.4. Using the plugin

    Enabling Clover for your project

    Clover can be enabled for any of your Java-based Eclipse projects.

    From the Project Explorer view, right click on your Java project. Select "Clover | Enable for this Project". With Clover now enabled, your project will now be automatically rebuilt. Open the Clover Coverage View by selecting "Window | Show View | Other..." and

    selecting Clover > Coverage. You should see your project listed with 0% coverageagainst it.

    Clover 2.0a5 User Manual

    Page 57Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    58/100

    Image of the Clover's context menu for a sample Java project without Clover enabled

    The Clover Coverage View

    The Coverage View allows you to control Clover's instrumentation of your Java projects, andshows you the coverage statistics for each project. The tree shows the project, package and

    Clover 2.0a5 User Manual

    Page 58Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    59/100

    class coverage and complexity information for all Clover-enabled project. Summary statistics

    are displayed along side the tree for the selected project/package/class.

    Image of the Clover Coverage View within Eclipse

    The Clover Viewer is automatically added to the workbench when you enable Clover foryour project. If the viewer is closed, you can open it again using "Window | Show View |Other..." and selecting "Clover | Clover View".

    The viewer allows the following actions:

    Refresh Coverage Data. Re-loads from disk the Clover coverage data for the selectedproject.

    Delete Coverage Data. Deletes the recordered coverage data for the selected project.

    Compile with Clover. Toggles the use of Clover instrumentation when Eclipse compilesthe selected Java project.

    Show Coverage in Editor. Shows or hides red/green coverage areas in open Javaeditors. This is useful for finding out exactly which parts of the code are being covered.

    Generate Coverage Cloud. Generates a report page in cloud tag format that lists classesconsidered project risks or quick wins.

    Generate Report. Launches the report generation wizard that will take you through thesteps required to generate a Pdf, Html or Xml.

    Hide Unavailable. This check button hides any elements in the Coverage View's treethat don't have associated coverage information and helps reduce visual clutter. Forinstance, with this button checked any project that isn't Clover-enabled will not be shownin the Coverage View.

    Hide 100% Covered. This check button hides any elements in the Coverage View's treethat have full coverage and helps let you focus on only those classes that require moretesting.

    Hide Unit Tests. This check button hides any classes defining JUnit / TestNG tests in the

    Clover 2.0a5 User Manual

    Page 59Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    60/100

    Coverage View's tree to help reduce visual distractions when trying to find classesneeding better code coverage.

    Viewing Coverage Results

    The Clover Eclipse plugin allows you to view Clover coverage data within the Eclipse IDE.This may include coverage data created using Clover external to the Eclipse IDE, orcoverage data generated by the Clover Plugin internal to Eclipse.

    Image of an Eclipse Java editor with coverage annotations enabled

    The Clover plugin shows coverage data in three ways:

    As a marker in the overview bar (right-hand side). This marker has a tooltip indicatingthe coverage problem.

    As a coloured annotation of the source code in the Java editor. If you wish to switch offthe source code annotations you can easily do so by deselecting the menu / toolbar item

    Clover 2.0a5 User Manual

    Page 60Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    61/100

    "Show Coverage in Editor" on the Coverage View. As a "tag cloud" report highlighting the classes that form major project risks (low

    coverage, hich complexity) and potential quick wins for increasing project coverage. Thisreport has two tabs, one tag for the project risks page and the other for quick wins page.Each page lists the classes of the project enlarged or reduced depending on theirsignificance to the report and clicking on any class name will open the correspondingsource file in an editor.

    Image of cloud report

    Instrumenting your code

    You can use the Clover Eclipse plugin to instrument the Java source in your project eachtime it is built. This option is activated on a per-project basis by toggling the "Compile withClover" button in the Clover Viewer.

    Disabling Clover in your project

    You can disable Clover instrumentation using the "Compile with Clover" button. You canprevent coverage information from being displayed in the Java editors by toggling the "ShowCoverage in Editor" button although this will apply to all Clover-enabled projects in theworkspace.

    Clover 2.0a5 User Manual

    Page 61Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    62/100

    If you want to completely de-activate Clover support in a project, then un-check "Enable

    Clover plugin in the project" on the Clover page of the project's properties dialog. You canalso achieve this by right clicking on the project and selecting "Clover | Disable for thisProject".

    4.2.5. Configuration options

    The Clover Eclipse plugin's configuration can be accessed in two places:

    From the "Clover" page of a project's properties dialog (Project | Properties). From the "Clover" page of the workspace preferences (Window | Preferences).

    Project Properties

    This release of the Clover plugin does not provide any per-project configuration options. Thefinal public release of the plugin will allow configuration of:

    Where Clover stores the coverage database. How often Clover writes coverage data to the disk. File filters that determine which files are instrumented. Context filters that determine which types of code are instrumented.

    Clover Preferences - General

    Clover 2.0a5 User Manual

    Page 62Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    63/100

    Image of the general page of the Clover plugin preferences

    When rebuilding projectWhen your rebuild a project, Clover will ask you whether you want to delete theexisting coverage information. This section allows you to specify what the defaultaction should be, and whether Clover should prompt you at all.Coverage visualization should refresh automaticallyIf enabled, the plugin will check for updated coverage data at the frequency givenbelow. If it is not enabled, then you will need to use the "Refresh Coverge Data"

    Clover 2.0a5 User Manual

    Page 63Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    64/100

    button to see newer coverage data.Coverage visualization should span coverage before buildThe span attribute allows you to control which coverage recordings are mergedto form a current coverage report. For more information, see Using spans.Miscellaneous settingsThis allows you to set the logging output of the plugin to one of three levels:minimal, verbose or debug.

    Clover Preferences - License

    Image of the license page of the Clover plugin preferencesLicense textWhen you receive a Clover license from Cenqua you should copy its contents tothis text box. If the license text is on the clipboard then clicking the "Paste" button

    Clover 2.0a5 User Manual

    Page 64Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    65/100

    will paste it to this text box automatically. If you have saved the Clover license toa file then clicking the "Load..." button will allow you to select the file and fill thetext box with its contents.SummaryThe summary box summarises the nature of the currently enabled license forClover.

    4.2.6. FAQ

    Q: Why can I only see coverage data for the last test case I executed? Why does mycoverage information disappear each time I Eclipse autocompiles a file?

    By default, Clover will display the coverage information gathered since your last compile -full build or auto build. You can change how far back in time Clover will look for coverage

    data by setting the Span parameter in the Clover page in the Workspace preferences(Window | Preferences).

    Clover 2.0a5 User Manual

    Page 65Copyright 2002-2004 Cenqua Pty Ltd. All rights reserved.

  • 8/2/2019 Clover 2 Beta Version 2 0a5

    66/100

    5. Advanced Usage

    5.1. Background: The Clover Coverage Database

    This section provides background information on the structure, lifecycle and management ofthe Clover database.

    5.1.1. Database structure and lifecycle

    The Clover database consists of several files that are constructed at various stages of theinstrumentation and coverage recording process. The following table shows the various filescreated if Clover is initialised with an initstring of "clover.db"

    Registry file

    Filename: clover.db

    Description: The Registry file contains information about all of the classes that have beeninstrumented by Clover. This file does not contain any actual coverage recording data.

    Lifecycle: The Registry file is written during the instrumentation process. If an existingRegistry file is found, the existing file is updated. If no Registry file is found, a new Registryfile is created. The Registry file is read by Clover-instrumented code when it is executed,and also during report generation or coverage browsing (such as via an IDE plugin or theSwing Viewer).

    ContextDef file

    Filename: clover.db.ctx

    Desription: The ContextDef file contains user-defined context definitions. Note that whilethis file is in plain text, it is managed by Clover and should not be edited directly by the user.

    Lifecycle: The ContextDef file is written prior to Clover instrumentation. The ContextDeffile is read during instrumentation, report generation and coverage browsing.

    CoverageRecording Files

    Filename: clover.dbHHHHHHH_TTTTTTTTTT orclover.dbHHHHHHH_TTTTTTTTTT.1 (where HHHHHHH and T