Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evosuite doesn't generate tests with a different GA #442

Open
sianico93 opened this issue Nov 28, 2022 · 2 comments
Open

evosuite doesn't generate tests with a different GA #442

sianico93 opened this issue Nov 28, 2022 · 2 comments

Comments

@sianico93
Copy link

Context

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

Steps to Reproduce

after compile evosuite 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_GA
where "EvoSuite" is the export where i declare the command "java -jar path_evosuite-master.jar"

Result

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

*** Conclusion
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?

@jose
Copy link
Member

jose commented May 9, 2023

You might need to also include -generateSuite at the end of your command. Long story short, MOSA and DynaMOSA require -generateMOSuite (which is currently the default behaviour) and any other GA requires -generateSuite. (This should perhaps be better documented.)

1 similar comment
@jose
Copy link
Member

jose commented May 9, 2023

You might need to also include -generateSuite at the end of your command. Long story short, MOSA and DynaMOSA require -generateMOSuite (which is currently the default behaviour) and any other GA requires -generateSuite. (This should perhaps be better documented.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants