Patchwork aims to be a general purpose coverage analysis tool for Java bytecode program. Its main objective is to provide a framework and some basic tools for creating custom coverage reports and use advanced or non standard coverage metrics.
Its current feature list is not really impressive, but it works (at least for me !):
A sample report (created from maven plugin) has been generated for project Muse Parser
Its planned features list is of course much more important. Here is a list of the most important things I am planning to do on Patchwork, given some more time to work on it:
Here is a list of less urgent things that may be done at some time in the future:
Code coverage measure is There already exists coverage tools for Java, working at the bytecode or source level, some of which are:
These tools are good but they all provide the same simple coverage measures: line and branch, which are the least powerful coverage measures for software defect detection. For an example of the difference between Cobertura and Patchwork, see the TDD and Coverage page. Emma is closest to Patchwork in its underpinnings.
What I wanted to do was an extensible coverage tool in which one could plug in its own measure and tailor it to its needs. Any practitioner knows fairly well that achieving even 100% line coverage requires tremendous efforts: As a basic rule of thumb, the effort is exponential as coverage increase. So why would someone need more sophisticated measures that would require more tests ? To manage risks. While 90% line coverage may be enough for simple components that do simple transformations or fulfill mainly simple hand-over tasks like transforming input strings into more complex objects, one may want to achieve 100% du-pairs or all-start-end-elementary-paths coverage on a core class.
Moreover, I wanted a tool to explore the relationship that one can infer from code coverage measures at the lowest-level to higher-level models or requirements. The later part is still in preliminary design phase, but I hope to have something to demonstrate real soon.
Finally, patchwork grew out of my interest for manipulating Java bytecode. It includes a simple library for manipulating class files and works by directly modifying class files while they are being loaded for testing.
This tool is in its early development stage and may not be suited to production use, in particular for large projects where performance is needed. Precise coverage information means a lot of data has to be processed, which may take a lot of time.
Some further limitations are described in the Technical details page, in particular related to the way coverage measures are computed. These limitations may yield to inaccuracy in the line covered information.
Feedback, suggestions and comments about this work are welcomed: Mail to abailly arobase oqube point com