arthur
arthur

Reputation: 403

Can i get the execution trace for a test case for a java program?

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?

Upvotes: 1

Views: 856

Answers (2)

Brian Agnew
Brian Agnew

Reputation: 272247

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.

Upvotes: 1

Charlie Martin
Charlie Martin

Reputation: 112356

Sure, just use the debugging API.

Upvotes: 2

Related Questions