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?
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
2009-04-17 13:00:19