views:

387

answers:

3

I've got two versions of a project with a JUnit test. Looking at the diff of the files there's no obvious reason to this, but the test passes on one project but not on the other.

For a while now I've wondered if there was a program that would record a trace through the whole program when it runs and save it to a file. This would be really handy for this exact example where I want a trace through both tests and then I want to diff them together.

Can anyone point me in the direction of a program that might be able to do this, or a way that I could diff the two program's flows?

Cheers

+2  A: 

I'd use Aspects for this. Check out AspectJ for instance, it is very easy to design a rule (point cut) that says "For all methods invoked in my Java code, log method name".

Lars Westergren
+2  A: 

If I understand your question correctly looks like this might partially achieve what you are after.

http://www.lambdacs.com/debugger/debugger.html

Yiannis
A: 

The Eclipse TPTP project has a trace engine that you might find useful.

Aaron Maenpaa