Skip to content

SabaPing/java-test-coverage-tool-asm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automated Coverage Collection Tool

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.

Java Agent

Build

Import project to Intellij Idea, then build artifact. The name of output artifact is "agent.jar"

Usage

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".

Example

VM arguement:

Imgur

Result:

Output format:

class name:

one method in this class:

all statements in this method, shown as line number in source code:

all covered statement:

Imgur

About

An automated coverage collection tool based on ASM byte-code manipulation framework.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages