You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm Jiseong, and have an issue with running Randoop on some large Apache projects. The situation is simple. No test, actually very little test is generated. It seems that many operations are not functioning well for my benchmarks, considering the steps are increasing fast in the progress log.
I've searched some keyword similar to "No tests generated", but I failed to find the same situation in the Issues and Troubleshooting section. If there's an answer somewhere, sorry to bother :(
Environment
Randoop version: tags/v4.3.0, tags/v4.3.1 (built with Java 11)
Java version: 11
Picked up JAVA_TOOL_OPTIONS: -Dapple.awt.UIElement=true
openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
# prepare the program
git clone https://github.com/apache/qpid-proton-j
cd qpid-proton-j
# build with maven 3.8.5 with Java 11 (JAVA_HOME must be set)
mvn compile package dependency:copy-dependencies -DskipTests -DskipITs -DfailIfNoTests=false
# Testing a class in the module `proton-j`cd proton-j
# Classpath includes every .jar in target/dependency, target/classes, and the jar of randoop
java -classpath $(printf %s: target/dependency/*.jar)target/classes:/Users/jiseong/github/randoop/randoop/build/libs/randoop-all-4.3.1.jar \
randoop.main.Main gentests --testclass=org.apache.qpid.proton.codec.EncoderImpl \
--junit-package-name=org.apache.qpid.proton.codec \
--testsperfile=1000000 --time-limit=120 --operation-history-log=operation-log.txt
Issues
Randoop output
// org/apache/qpid/proton/codec/RegressionTest0.javapackageorg.apache.qpid.proton.codec;
importorg.junit.FixMethodOrder;
importorg.junit.Test;
importorg.junit.runners.MethodSorters;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
publicclassRegressionTest0 {
publicstaticbooleandebug = false;
@Testpublicvoidtest1() throwsThrowable {
if (debug)
System.out.format("%n%s%n", "RegressionTest0.test1");
org.apache.qpid.proton.codec.DecoderImpldecoderImpl0 = null;
// The following exception was thrown during execution in test generationtry {
org.apache.qpid.proton.codec.EncoderImplencoderImpl1 = neworg.apache.qpid.proton.codec.EncoderImpl(decoderImpl0);
org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: Cannot invoke \"org.apache.qpid.proton.codec.DecoderImpl.register(org.apache.qpid.proton.codec.PrimitiveType)\" because \"decoder\" is null");
} catch (java.lang.NullPointerExceptione) {
// Expected exception.
}
}
@Testpublicvoidtest2() throwsThrowable {
if (debug)
System.out.format("%n%s%n", "RegressionTest0.test2");
java.lang.Objectobj0 = newjava.lang.Object();
java.lang.Class<?> wildcardClass1 = obj0.getClass();
org.junit.Assert.assertNotNull(wildcardClass1);
}
}
Minor question: It seems that test2 is not for testing my CUT. Why does Randoop generate this one?
Sample output expected
// The shape of test I expected@Testpublicvoidtest() {
DecoderImpldecoderImpl0 = newDecoderImpl();
EncoderImplencoderImpl0 = newEncoderImpl(decoderImpl0);
Map<String, Object> map0 = newHashMap<>();
map0.put("a", newObject());
encoderImpl0.writeMap(map0);
}
// The sample tests that other test generation tools generated// 1. EvoSuite@Testpublicvoidtest12() throwsThrowable {
DecoderImpldecoderImpl0 = newDecoderImpl();
EncoderImplencoderImpl0 = newEncoderImpl(decoderImpl0);
long[] longArray0 = newlong[2];
// Undeclared exception!encoderImpl0.writeArray(longArray0);
}
// 2. Research artifact (WIP privately) in my lab@Testpublicvoidtest() {
DecoderImpldecoderImpl2 = newDecoderImpl();
encoderImpl2 = newEncoderImpl(decoderImpl2);
boolean[] booleanArray0 = newboolean[]{ true, true, true };
encoderImpl2.writeArray(booleanArray0);
}
Misc. Log files
terminal output
Picked up JAVA_TOOL_OPTIONS: -Dapple.awt.UIElement=true
Randoop for Java version "4.3.1, local changes, branch HEAD, commit a064326, 2022-07-14".
Will try to generate tests for 1 classes.
PUBLIC MEMBERS=64
Explorer = ForwardGenerator(steps: 0, null steps: 0, num_sequences_generated: 0;
allSequences: 0, regresson seqs: 0, error seqs: 0=0=0, invalid seqs: 0, subsumed_sequences: 0, num_failed_output_test: 0;
sideEffectFreeMethods: 1113, runtimePrimitivesSeen: 38)
Progress update: steps=1, test inputs generated=0, failing inputs=0 (2022-07-19T23:09:34.832539Z 55.5M used)
Progress update: steps=1000, test inputs generated=3, failing inputs=0 (2022-07-19T23:09:35.435366Z 44.3M used)
...
Progress update: steps=31066000, test inputs generated=3, failing inputs=0 (2022-07-19T23:11:34.824553Z 157M used)
Progress update: steps=31067000, test inputs generated=3, failing inputs=0 (2022-07-19T23:11:34.828322Z 157M used)
Progress update: steps=31067708, test inputs generated=3, failing inputs=0 (2022-07-19T23:11:34.831043Z 165M used)
Normal method executions: 20
Exceptional method executions: 1
Average method execution time (normal termination): 0.00371
Average method execution time (exceptional termination): 1.27
Approximate memory usage 165M
Explorer = ForwardGenerator(steps: 31067708, null steps: 31067705, num_sequences_generated: 3;
allSequences: 3, regresson seqs: 2, error seqs: 0=0=0, invalid seqs: 0, subsumed_sequences: 0, num_failed_output_test: 1;
sideEffectFreeMethods: 1113, runtimePrimitivesSeen: 38)
No error-revealing tests to output.
About to look for failing assertions in 2 regression sequences.
Regression test output:
Regression test count: 2
Writing regression JUnit tests...
Created file /Users/jiseong/github/apache/qpid-proton-j/proton-j/org/apache/qpid/proton/codec/RegressionTest0.java
Created file /Users/jiseong/github/apache/qpid-proton-j/proton-j/org/apache/qpid/proton/codec/RegressionTest.java
Wrote regression JUnit tests.
About to look for flaky methods.
Invalid tests generated: 0
Since I'm planning to compare my work with Randoop, I want to know whether I've misused it or not. Thanks in advance for any help you're able to provide.
The text was updated successfully, but these errors were encountered:
jiseongg
changed the title
No (very little) tests generated for projects with very fast increase of "steps"
No (or very little) test generated for some Apache projects
Jul 19, 2022
Hi, I'm Jiseong, and have an issue with running Randoop on some large Apache projects. The situation is simple. No test, actually very little test is generated. It seems that many operations are not functioning well for my benchmarks, considering the steps are increasing fast in the progress log.
I've searched some keyword similar to "No tests generated", but I failed to find the same situation in the Issues and Troubleshooting section. If there's an answer somewhere, sorry to bother :(
Environment
Reproduction
Issues
Minor question: It seems that test2 is not for testing my CUT. Why does Randoop generate this one?
Misc. Log files
Since I'm planning to compare my work with Randoop, I want to know whether I've misused it or not. Thanks in advance for any help you're able to provide.
The text was updated successfully, but these errors were encountered: