Mohamed Ali Jinnah
Mohamed Ali Jinnah

Reputation: 21

EvoSuite test generation stucks when using maven plugin

I Have followed steps given in the site to configure maven plugin. When I give "mvn evosuite:generate", it hangs with below detail in console.

[INFO] Going to start job for: com.emirates.gws.service.grouprequest.GroupRequestServiceImpl.

Following are the environment detail Windows 7 maven-3.2.1 jdk1.7.0_72

Following are the detail shown in console

 [INFO] --- evosuite-maven-plugin:0.2.0:generate (default-cli) @ gws-grouprequest-implementation ---
[WARNING] The POM for org.slf4j:slf4j-api:jar:1.7.12 is missing, no dependency information available
[WARNING] The POM for org.ow2.asm:asm-all:jar:5.0.4 is missing, no dependency information available
[WARNING] The POM for dk.brics.automaton:automaton:jar:1.11-8 is missing, no dependency information available
[WARNING] The POM for com.googlecode.gentyref:gentyref:jar:1.2.0 is missing, no dependency information available
[WARNING] The POM for net.sf.jgrapht:jgrapht:jar:0.8.3 is missing, no dependency information available
[WARNING] The POM for commons-cli:commons-cli:jar:1.3 is missing, no dependency information available
[WARNING] The POM for org.kohsuke:graphviz-api:jar:1.1 is missing, no dependency information available
[INFO] Going to generate tests with EvoSuite
[INFO] Total memory: 800mb
[INFO] Time per class: 2 minutes
[INFO] Number of used cores: 1
[INFO] Target: D:\EGIT\Projects\GWS\Source\gws-project-MICE\gws-grouprequest\gws-grouprequest-implementation\target\classes
[INFO] Basedir: D:\EGIT\Projects\GWS\Source\gws-project-MICE\gws-grouprequest\gws-grouprequest-implementation
[INFO] SLF4J: Class path contains multiple SLF4J bindings.
[INFO] SLF4J: Found binding in [jar:file:/D:/EGIT/Projects/GWS/M2_REPO/org/evosuite/evosuite-master/0.2.0/evosuite-master-0.2.0.jar!/org/slf4j/impl/S
taticLoggerBinder.class]
[INFO] SLF4J: Found binding in [jar:file:/D:/EGIT/Projects/GWS/M2_REPO/org/evosuite/evosuite-runtime/0.2.0/evosuite-runtime-0.2.0.jar!/org/slf4j/impl
/StaticLoggerBinder.class]
[INFO] SLF4J: Found binding in [jar:file:/D:/EGIT/Projects/GWS/M2_REPO/ch/qos/logback/logback-classic/1.1.3/logback-classic-1.1.3.jar!/org/slf4j/impl
/StaticLoggerBinder.class]
[INFO] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
[INFO] SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
[INFO] * EvoSuite
[INFO] [MASTER] 21:49:11.703 [main] WARN  ProjectAnalyzer - Cannot handle com.emirates.gws.service.payments.PaymentServiceImpl due to: class java.lan
g.ClassNotFoundException Method code too large!
[INFO] Going to execute 32 jobs
[INFO] Going to start job for: com.emirates.gws.service.grouprequest.GroupRequestServiceImpl

Upvotes: 2

Views: 1409

Answers (1)

arcuri82
arcuri82

Reputation: 970

From your settings, it looks like you are using 1 core, 2 minutes per class, and trying to generate tests for 32 classes: this means it will take up to 64 minutes to complete. However, each time a new class is done (roughly every 2 minutes), you should get a new entry in the logs.

Btw, it seems you are using only 800MB of memory. Just in case, it is better to use some more, eg 1-1.5GB

Following is bit worrying:

[INFO] [MASTER] 21:49:11.703 [main] WARN  ProjectAnalyzer - Cannot handle com.emirates.gws.service.payments.PaymentServiceImpl due to: class java.lan
g.ClassNotFoundException Method code too large!

Java does have limits on how large a method can be. EvoSuite needs to add some instrumentation on the bytecode to work, and that might lead to exceed the limit :(

Upvotes: 2

Related Questions