FAQ - llmhyy/evosuite-plus-plus GitHub Wiki
We can check and debug org.evosuite.executionmode.TestGeneration.generateTests(Strategy strategy, String target, List<String> args)
for more details.
We can check whether the classpath is set correctly by looking into
org.evosuite.executionmode.TestGeneration.executeTestGeneration(Options options, List<String> javaOpts, CommandLine line)
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.
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.
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.