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]

Tornado Labs Ltd.
http://www.tornadolabs.com
 

-----Original Message-----
From: Discussion list for Java 3D API [mailto:[EMAIL PROTECTED]]On Behalf Of Kyle Wayne Kelly
Sent: Saturday, March 24, 2001 3:15 PM
To: [EMAIL PROTECTED]
Subject: Debugging idea

I want to write a tester that logs every path through a piece of code.  It could then be used to test code.  The program would change the byte code, such that all unique paths through the code are logged.  What do you all think of this idea?
 
 /**
  * Kyle Wayne Kelly
  * Computer Science Student
  * University of New Orleans
  * 504-391-3985
  * http://www.cs.uno.edu/~kkelly
  * Glory to God!
  */

Reply via email to