0

I am working on a testing project using mutating technique. My project requires to manipulate a Java classfile and re-execute the classfile multiple times for testing. My implementation need to re-execute the whole system again after one manipulation, and that is not efficient. I am wondering whether I can save the JVM state right before executing a desired instruction in the classfile, so that I can start from that state after each manipulation.

Thank you.

Anh Cuong
  • 131
  • 1
  • 3

2 Answers2

0

Apache Javaflow does that... sort of.

You could save a continuation right before your test. And then continue from there.

I don't know exactly what you need to test, or if it is exactly what you were looking for (in Feb 2011 :S) but at least the Javaflow codebase might be "inspiring".

I neither know what's the status of the project. You should check if it's currently being maintained.

Martín Schonaker
  • 7,273
  • 4
  • 32
  • 55
0

Based on your description, I don't believe you need to maintain the 'JVM state'. You can mantain a reference to the original class file and re-run that.

Amir Afghani
  • 37,814
  • 16
  • 84
  • 124
  • Hi Amir, probably you are right, but I need to maintain a clone reference to the original object, in case the object will change. Let me be more specific. Suppose that I mutate a class method in many different ways and I want to execute the method multiple times, I need to maintain: i) the object state at which the method is executed in the original system ii) inputs of the method. Is it the correct way to do, if it is I also don't know how to remember the reference to the object. – Anh Cuong Feb 13 '11 at 12:46