Kyle,
There
are some commercial products you could look at. It sounds like you are
after some sort of code coverage analysis or path analysis. Path analysis is
becoming quite popular at the moment (McCabe's complexity analysis) both at
runtime (dynamic) and at compile time (static).
As a
matter of interest I wrote a C++ program about 6 months ago that modifies Java
byte code (in memory, while the class is loaded by the class loader) by
inserting a static method call at the beginning of every method in a targeted
class. The code still needs a little work, but I am planning on posting the
program (currently Windows only - NIX to come) within the next few
weeks.
Evaluating *all paths* through a program statically is a big task. The
Java byte code control flow is quite rich (including exceptions), and I expect
the combinatorial explosion in paths through any "real" program will quickly
become quite computationally intensive. I suspect it would be much easier to
modify the byte code to write a log of which methods were called during a given
run and then use the log and the reflection API to do some simple code coverage
analysis.
Best
of luck!
Daniel
Selman
[EMAIL PROTECTED]
|
- [JAVA3D] Debugging idea Kyle Wayne Kelly
- Daniel Selman