views:

246

answers:

2

I want to run a java program with some test input values and when the execution ends I want to know the complete execution trace, for each conditional statement - what path was followed. Is there anything that can help me with this?

+1  A: 

Sure, just use the debugging API.

Charlie Martin
A: 

You may want to have a look at AspectJ.

You can transparently intercept and log code execution using this. I'm not sure you can intercept every (say) if() statement, but you can certainly intercept method calls etc., and you should hopefully then be able to derive the execution flow from there.

Brian Agnew