Use ASM byte-code manipulation framework to build an automated coverage collection tool that can capture the statement coverage for the program under Junit test.
- use Java Agent to perform on-the-fly code instrumentation.
Import project to Intellij Idea, then build artifact. The name of output artifact is "agent.jar"
Copy agent.jar to anywhere you want. Choose a project you want to analyze. This project must use Junit framework. Before run Junit test, add VM arguement "-javaagent:<path to agent.jar>=<your project name>", then run test. The result will show in "System.out".
Output format:
class name:
one method in this class:
all statements in this method, shown as line number in source code:
all covered statement:

