FAQ - llmhyy/evosuite-plus-plus GitHub Wiki

1. What if Evosuite++ cannot find the target method/class?

We can check and debug org.evosuite.executionmode.TestGeneration.generateTests(Strategy strategy, String target, List<String> args) for more details.

2. What if Evosuite++ finish in no time and report zero coverage?

We can check whether the classpath is set correctly by looking into org.evosuite.executionmode.TestGeneration.executeTestGeneration(Options options, List<String> javaOpts, CommandLine line)

3. How can we force Evosuite to reuse (or not reuse) existing variable when generating test case?

We can modify the value of Properties.PRIMITIVE_REUSE_PROBABILITY. A value of 1 will force Evosuite to always reuse an existing variable, while a value of 0 will force Evosuite to not reuse any existing variables.

4. Why I sometimes cannot retrieve the control dependencies of a branch/instruction

Sometimes, the control flow cannot be parsed (i.e., a branch cannot get control dependencies) because the branch/instruction has not been registered.

In this case, we shall call this API: GraphPool.getInstance(TestGenerationContext.getInstance().getClassLoaderForSUT()).registerClass(className), in which BytecodeInstructionPool will be invoked to register the branches.

However, if we use some APIs like:

bytecodeAnalyzer.analyze(classLoader, className, methodName, innerNode);
bytecodeAnalyzer.retrieveCFGGenerator().registerCFGs();

The java class will be registered, however, the branches will not be registered.

5. Why the EvoSuite process does not stop when we invoke the EvoSuite API in Java

It could be a bug, we will further investigate this issue. For now, there are two solutions for this. First, we can use JUnit method as the entry method, the problem can disappear. Second, we can collect the running threads by

Thread[] threadArray = new Thread[Thread.activeCount() + 2];
Thread.enumerate(threadArray);

Then, we use reflection to get the threads of ThreadPoolExecutor and shutdown them.

⚠️ **GitHub.com Fallback** ⚠️