EvoSuite / evosuite

EvoSuite - automated generation of JUnit test suites for Java classes
http://www.evosuite.org
GNU Lesser General Public License v3.0
832 stars 341 forks source link

Code coverage is very low for few classes. How to improve? #330

Closed chaitra-daddolu closed 3 years ago

chaitra-daddolu commented 3 years ago

Context

The code coverage is very less for generated test suites. What can be done to get more coverage. I'm using evosuite version 1.0.6. Also when I try with version 1.1.0 the code coverage is much lesser than the previous one. Can I get some help regarding this.

apanichella commented 3 years ago

Hi, can you give us more info about the class you are testing?

chaitra-daddolu commented 3 years ago

I'm creating test suites on classes which are used for parsing language files like c, cpp, terraform etc to find some insights. Though I increase time per class still not getting satisfactory results.

chaitra-daddolu commented 3 years ago

`

org.evosuite.plugins
            <artifactId>evosuite-maven-plugin</artifactId>
            <version>1.0.6</version>
            <executions>
                <execution>
                    <id>prepare</id>
                    <goals>
                        <goal>prepare</goal>
                    </goals>
                    <phase> generate-test-sources </phase>
                </execution>
                <execution>
                    <id>generate</id>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                    <phase> 
                      generate-test-sources 
                    </phase>
                    <configuration>
                        <numberOfCores>2</numberOfCores>
                        <memoryInMB>3000</memoryInMB>
                        <timeInMinutesPerClass>5</timeInMinutesPerClass>
                        <cutsFile>${test.resource.dir}${file.separator}evosuite_cuts_file.txt</cutsFile>
                    </configuration>
                </execution>
                <execution>
                    <id>export</id>
                    <goals>
                        <goal>export</goal>
                    </goals>
                    <phase> generate-test-sources </phase>
                </execution>
            </executions>

`

VoglSebastian commented 3 years ago

I assume the low coverage is caused by the fact that most of your coverage goals require syntactically correct programs as input.