Introduction dbrad-jacocoverage

Code coverage is a very useful tool for the development of applications of all kinds. Coverage is most useful in test-driven-development, but also for other development methodologies where testing for code coverage adds significant value to quality.

Dbrad-jacocoverage uses www.elcemma.org jacocoagent to do on-the-fly code coverage, in that it instruments at run time and captures coverage data during the run. Then the coverage data is processed to obtain results.

Also, dbrad-jacocoverage is a significant modification to tikione-jacocoverage, which has been in an archived status since May/2016. There are modified and additional capabilities in dbrad-jacocoverage which handle project dependencies, include and exclude package patterns better and in a more configure-able manner (see following dbrad-jacocoverage capabilities ).

Table of contents

About dbrad-jacocoverage

Dbrad-jacocoverage provides basic global-settings which does only a project's source folder coverage of a principle-project. Processing beyond just the principle-project, requires the project-specific settings to expand coverage components to include coverage for source & test-source folders, packages within folder(s), and selection of dependent/associated/sub-project projects as inclusive components. This implies that a Netbeans project as a whole and its coverage is achieve-able, with selective component management thrown in (say: just JUnits).

Background

Coverage may be used in an operational/QA management process to assist in determining quality by adding coverage metrics as an additional measure, but by no means the only measure. However for development, coverage provides quick feedback as to a developer's exercise of their code (assuming they build supporting tests to exercise their code).

dbrad-jacocoverage came about due to a need to code-coverage a project which has multiple libraries as dependent/associate projects. The existing coverage tools on Netbeans IDE prior to dbrad-jacocoverage were limiting or expensive. Also, most other coverage tools for Netbeans appear to be retired, archived, or no longer maintained; so another reason for dbrad-jacocoverage.

dbrad-jacocoverage was created from tikione-jacocoverage as its base. The latter being limited to processing only the source-code folders for a single J2SE/J2EE project (that is: non-inclusive for dependent projects, test source code [JUnit,...]). Later in tikione's development, NB-module (NBM) coverage was added with a slightly different processing architecture suitable for NBMs, but it too is non-inclusive for test source code.

Tikione-jacocoverage has been archived by its author. See https://github.com/jonathanlermitage/tikione-jacocoverage.

dbrad-jacocoverage capabilities

A brief description of dbrad-jacocoverage capabilities follows:    [      colored items are dbrad-jacocoverage enhancements]

Reporting
  • Source-code high-lighting
    • High-light the source-code and/or test-source-code against coverage captured data.
    • Dependent/associate projects are inclusive upon configuration setting.
  • XML report
    • Captured data converted to XML file, which may be used in post-processing of coverage data.
  • Console report
    • Report to an IDE output console which will display for single and/or associate-projects.
    • Test-source-code is inclusive in reports upon configuration setting.
    • Support of by-project or by-grouped/bundled report layouts.
  • HTML report
    • Report to HTML file format, for single and/or associate-projects formats.
    • Test-source-code is inclusive in reports upon configuration setting.
    • Support of by-project or by-grouped/bundled report layouts.
  • Generation of reports
    • Reporting for source-code and/or test-source-code.
    • Reporting on associate-projects.
    • Project(s), folder(s) and package(s) reporting.
    • Support of by-project or by-grouped/bundled report layouts.
  • Operational/QA management
    • Report into default or an explicit user defined directory.
    • Report as time-stamped directory/files for operational post-processing or QA archiving.
    • Manage time-stamped report storage, so only N report time-stamp directories are retained.
Coverage of packages Set which packages are to be explicitly included or excluded, for a project and/or its associate-projects and/or its source-folder(s).
Run w/jacocoverage
Test w/jacocoverage
Invokes ANT code-coverage execution for a project, as a Netbeans 'run' or 'test' component.
  • Project level:
    • Projects-view project context-menu items.
    • Files-view project context-menu items.
Run file w/jacocoverage
Test file w/jacocoverage
Invokes ANT code-coverage execution for a file, as a Netbeans 'run file' or 'test file' component.
  • Single file: (Run or test is presented as appropriate to the file selected.)
    • Projects-view file context-menu items.
    • Files-view file context-menu items.
    • Java file editor editor context menu items.
Reset (w/jacocoverage) Resets the hi-lighting on the source files.
  • Project level:
    • Projects-view project-context-menu item named differently.
    • Files-view project-context-menu item.
Merge clear (w/jacocoverage) Clears the merge processing algorithm for all runs of a project-specific configuration setting for a project. This menu item only shows if merge capability is set in the configuration settings.
  • Project level:
    • Projects-view project-context-menu item named differently.
    • Files-view project-context-menu item.
Associate-projects A project may depend on other associated-projects as set via the project-properties > libraries tab, these are include-able in the processing upon configuration setting.