Closed baptisteroziere closed 3 years ago
Hi @brozi,
I believe you must inform EvoSuite to compute mutation score of the generated suite, e.g.,
-Danalysis_criteria="LINE,BRANCH,EXCEPTION,WEAKMUTATION,OUTPUT,METHOD,METHODNOEXCEPTION,CBRANCH,STRONGMUTATION"
By default, EvoSuite only computes coverage/mutation for the enabled criterion.
-- Best, Jose
Thank you @jose , it works !
Context
I am trying to generate some pairs of (method/class, high-quality tests). I'm trying to generate tests for many methods or classes and to use some metrics to select the ones for which the tests were of high quality. For quality, I mostly want to make it difficult to write functions that are semantically incorrect and still pass the tests (I'm not really concerned with test verbosity). I am trying to maximize the mutation score as it seems to be a pretty good proxy for my "quality" metric and I'd like to keep all the assertions since useless assertions are not a problem for me. As I was playing with the parameters described in the tutorial, I encountered an issue when simultaneously setting the assertion strategy to all and asking for the MutationScore in the output.
Steps to Reproduce
Please break down here below all the needed steps to reproduce the issue. [If possible, please upload an example of the project you are generating tests for.]
javac tutorial/Stack.java
java -jar evosuite-1.1.0.jar -class tutorial.Stack -Doutput_variables=configuration_id,TARGET_CLASS,criterion,Total_Branches,Covered_Branches,BranchCoverage,Lines,Covered_Lines,LineCoverage,MethodCoverage,Size,Length,MutationScore -projectCP=. -Dminimize=false -Dsearch_budget=20 -Dassertion_strategy=ALL
EvoSuite Arguments
Current Result
evosuite successfully generates tests and writes them to file but the MutationScore variable is missing and it fails to generate an output. Here is the end of the terminal output:
Expected result
I expected evosuite to also compute the strong mutation score and write it in the stats file.
Additional information
I downloaded the evosuite jar today using this link https://github.com/EvoSuite/evosuite/releases/download/v1.1.0/evosuite-1.1.0.jar