I am doing some Java application instrumentation. But the available instrumentation tools that use ASM or BCEL only allow to instrument the bytecode. Do you guys know of some tool that can instrument the execution of the application (as in the stuff that is not just there in bytecode but the JVM did it).
For example, if the application has a class A
class A
{
int a;
public A()
{}
}
When I do A obj = new A(), then the byte code will not contain any write to obj.a, but the JVM will do that, AFIK.
There is other stuff as well that can not be captured in bytecode. So, can you guys tell me if there exists such a framework that can capture the operations executed by the JVM.
If you want complete control over the instrumentation, you ideally need complete access to the source and the ability to modify it. Otherwise you are at the mercy of what the bytecode retains.
Our DMS Software Reengineering Toolkit is a program transformation system that provides such access to the source. Using its Java Front End, DMS can parse (Java) code, build ASTs, apply arbitrary transforms to the ASTs and regenerated instrumented Java code.
What you choose to instrument is up to you. This paper on instrumenting code describes how to build classic test coverage, but the ideas are general.