evosuite reports other coverage data than jacoco

171 views
Skip to first unread message

Henrik Schole

unread,
May 24, 2016, 10:14:33 PM5/24/16
to EvoSuite
Dear all,

in my current project, evosuite seems to report other coverage data during test suite generation time than the tool that I use at runtime.

To reproduce the situation, you can find the code
https://bitbucket.org/h_schole/xcorpus-sample

Usage (installed java, ant and mercurial needed):
Clone, then

cd into xcorpus-sample/antlr-3.4/.xcorpus

To execute and produce the runtime coverage report call
ant -f exercise.xml generated-tests

If you wish to re-generate the relevant test call
ant -f exercise.xml generate-single-test


The evosuite report is located in antlr-3.4/.xcorpus/evosuite-report,
the jacoco report in antlr-3.4/.xcorpus/output/TIMESTAMP/ in different formats.

The relevant class is org.antlr.misc.Barrier.


For this class,

Evosuite reports ~98% coverage (seems to be branch coverage?)

Jacoco reports 91% instruction coverage and 75% branch coverage.


Do you see any reason for this?

Thank you for your time,
Henrik

José Miguel Rojas

unread,
May 25, 2016, 10:03:38 AM5/25/16
to Henrik Schole, EvoSuite
Dear Henrik,

Two factors might have to do with the disagreement you are seeing.

First, by default, EvoSuite targets a combination of several coverage criteria, which are indicated in the 'criterion' column of the report:

> cat evosuite-report/statistics.csv 
TARGET_CLASS,criterion,Coverage,Total_Goals,Covered_Goals,,,,,,,
org.antlr.misc.Barrier,LINE,BRANCH,EXCEPTION,WEAKMUTATION,OUTPUT,METHOD,METHODNOEXCEPTION,CBRANCH,0.975,49,43

You can decide which criteria to target using the "-criterion" option, e.g., "-criterion BRANCH" will only target branch coverage.

Second, branch coverage is simply interpreted by most coverage tools like Jacoco as the number of branches of conditional statements covered by the test suite. EvoSuite, in contrast, looks at branches at the control flow graph level. Moreover, methods without any branching also contribute to the coverage computation for EvoSuite.

Hope that helps. Cheers,


--
You received this message because you are subscribed to the Google Groups "EvoSuite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to evosuite+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/evosuite/4afc3a19-a2ce-40d1-84c4-31f53f72def9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
José Miguel
Message has been deleted

Henrik Schole

unread,
May 29, 2016, 7:24:17 PM5/29/16
to EvoSuite, henrik...@gmail.com
Dear Jose,

alright, thanks for the fast reply.

Are there other ways to modify the report format? For the research project I am working on it would be of interest to keep the individual coverage criterions (one column each for branch, method etc.)

Cheers,
Henrik

Jose Miguel Rojas Siles

unread,
May 31, 2016, 12:21:52 PM5/31/16
to EvoSuite, henrik...@gmail.com
Sure, there is the "output_variables" argument, e.g.:

-Doutput_variables="TARGET_CLASS,Size,Length,criterion,Coverage,BranchCoverage,MethodCoverage,OutputCoverage"

Cheers,

Henrik Schole

unread,
Jun 6, 2016, 8:17:07 PM6/6/16
to EvoSuite, henrik...@gmail.com
Great, that's exactly what I was looking for. Thanks!

Devendra Reddy

unread,
Jun 29, 2020, 7:04:12 AM6/29/20
to EvoSuite
Can you tell me how u used evosuite with ANT for generating the test cases
Reply all
Reply to author
Forward
0 new messages