evosuite doesn't generate tests with a different GA

110 Views Asked by At

for university purposes i'm trying to extend evosuite. before i'm tryng to run it first with a different GA, without success.

I'm using evosuite 1.2.1 on ubuntu 12.0.4 and after compile it with maven, following the tutorial on the website, i try to run evosuite having changed some parameters like GA.

Reading the documentation, the command line i wrote is this:

$EvoSuite -class tutorial.Stack -projectCP Tutorial_Stack/target/classes/ -Dalgorithm=CELLULAR_GAw

here "EvoSuite" is the export where i declare the command

java -jar path_evosuite-master.jar

the result is this:

EvoSuite 1.2.1-SNAPSHOT
Going to generate test cases for class: tutorial.Stack
Starting Client-0
Connecting to master process on port 6197
Analyzing classpath:
Tutorial_Stack/target/classes/
Finished analyzing classpath
Generating tests for class tutorial.Stack
Test criteria:
Line Coverage
Branch Coverage
Exception
Mutation testing (weak)
Method-Output Coverage
Top-Level Method Coverage
No-Exception Top-Level Method Coverage
Context Branch Coverage
Running the Cellular GA with the 'LINEAR_FIVE' neighbourhoods model
Computation finished
[MASTER] 19:37:01.611 [logback-2] ERROR ClientNodeImpl - Error when generating tests for: tutorial.Stack with seed 1669660620731. Configuration id : null
java.lang.UnsupportedOperationException: isMaximizationFunction() called on mock
at org.evosuite.ga.FitnessFunctionMock.isMaximizationFunction(FitnessFunctionMock.java:81)
at org.evosuite.ga.localsearch.DefaultLocalSearchObjective.addFitnessFunction(DefaultLocalSearchObjective.java:70)
at org.evosuite.ga.metaheuristics.GeneticAlgorithm.addFitnessFunction(GeneticAlgorithm.java:430)
at java.util.ArrayList.forEach(ArrayList.java:1259)
at org.evosuite.ga.metaheuristics.GeneticAlgorithm.addFitnessFunctions(GeneticAlgorithm.java:434)
at org.evosuite.strategy.MOSuiteStrategy.generateTests(MOSuiteStrategy.java:88)
at org.evosuite.TestSuiteGenerator.generateTests(TestSuiteGenerator.java:630)
at org.evosuite.TestSuiteGenerator.generateTestSuite(TestSuiteGenerator.java:208)
at org.evosuite.rmi.service.ClientNodeImpl.lambda$startNewSearch$0(ClientNodeImpl.java:140)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
[MASTER] 19:37:01.716 [main] ERROR SearchStatistics - No statistics has been saved because EvoSuite failed to generate any test case
[MASTER] 19:37:01.816 [main] ERROR TestGeneration - failed to write statistics data

if I have not misunderstood, the system runs using the GA chosen, but fails to generate tests.

can anyone help me to understand how to use it with different ga successfully?

0

There are 0 best solutions below