Giter VIP home page Giter VIP logo

randoop's Introduction

Randoop unit test generator for Java

Randoop is a unit test generator for Java. It automatically creates unit tests for your classes, in JUnit format.

Learn about Randoop:

Directory structure

  • agent - subprojects for Java agents (load-time bytecode rewriting)
  • gradle - the Gradle wrapper directory (Should not be edited)
  • lib - jar files for local copies of libraries not available via Maven
  • scripts - git hook scripts
  • src - source directories for Randoop, including
    • coveredTest - source for JUnit tests of the covered-class Java agent
    • distribution - resource files for creating the distribution zip file
    • docs - documentation, including the manual and resources
    • javadoc - resource files for creating API documentation
    • main - Randoop source code
    • replacecallTest - source for JUnit tests of the replacecall Java agent
    • systemTest - source for Randoop system tests
    • test - source for JUnit tests of Randoop
    • testInput - source for libraries used in Randoop testing

The source directories follow the conventions of the Gradle Java plugin, where each directory has a java subdirectory containing Java source, and, in some cases, a resources subdirectory containing other files.

randoop's People

Contributors

aymandf avatar bjkeller avatar carloslima avatar caseyxing avatar dependabot-preview[bot] avatar dependabot[bot] avatar gorla avatar huangwaylon avatar ivan-kocherhin avatar jckling avatar kelloggm avatar kuro1fury avatar liliatangxy avatar linozem avatar markro49 avatar mdernsta avatar mernst avatar peskal avatar renovate[bot] avatar rjust avatar smillst avatar snowonion avatar thadguidry avatar varuniy avatar zhang-sai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

randoop's Issues

Randoop does not remove sequences that throw randoop.util.ReflectionExecutor.TimeoutExceeded.

I'm using randoop (with the option -usethreads=TRUE) to generate tests for the 
JHotDraw application but the test suite created by it contains tests with the 
following piece of code:

  try {
      ...
      fail("Expected exception of type randoop.util.ReflectionExecutor.TimeoutExceeded");
    } catch (randoop.util.ReflectionExecutor.TimeoutExceeded e) {
      // Expected exception.
    }

What is the expected output? What do you see instead?

Randoop should remove the tests that contain the TimeoutExceeded exception from 
the test suite. 

By looking the source code of randoop (class GenTests.java), I saw that it 
contains the following check:

 if (eec.get_value().equals("randoop.util.ReflectionExecutor.TimeoutExceeded")) {           
              keep = false;
  …
 }

but the value returned by eec.get_value() is 
"randoop.util.ReflectionExecutor$TimeoutExceeded" instead of 
"randoop.util.ReflectionExecutor.TimeoutExceeded", so, I changed it and it 
works now. 

What version of the product are you using? On what operating system?

Randoop 1.3.2 on Mac OS Lion. 


Original issue reported on code.google.com by [email protected] on 14 Dec 2011 at 1:44

Randoop throws AssertionError for a math package

What steps will reproduce the problem?
1. Download the org.apache.commons.math3 package
2. Test the package (a list with all package classes provided with the 
--classlist parameter)
3. Observe Randoop exiting with an assertion error

What is the expected output? What do you see instead?

The expected output should be without exceptions, resulting in Randoop writing 
generated unit tests to the file system.

Instead I get the following:

Creating Junit tests (2236 tests)...Throwable thrown while handling 
command:java.lang.AssertionError
java.lang.AssertionError
        at randoop.main.GenTests.handle(GenTests.java:529)
        at randoop.main.Main.nonStaticMain(Main.java:80)
        at randoop.main.Main.main(Main.java:42)
Randoop failed.
Last sequence under execution:var0 =  prim : int:1079574528 : 
var1 =  prim : boolean:true : 
var2 =  cons : 
org.apache.commons.math3.stat.regression.MillerUpdatingRegression.<init>(int,boo
lean) : var0 var1

What version of the product are you using? On what operating system?

Randoop 1.3.3. The operating system is GNU/Linux Trisquel 6.0.

Please provide any additional information below.

This is the command that I used to run Randoop:

java $JVM_FLAGS -ea -cp lib/randoop.jar:lib/junit4.jar:../src/ 
randoop.main.Main gentests --classlist=classlist.txt 
--junit-output-dir=tests-round-1/ --junit-classname=Randoop1Test --timelimit=60 
--forbid-null=false --small-tests=true --testsperfile=1

File classlist.txt is attached.

Original issue reported on code.google.com by [email protected] on 16 Nov 2013 at 4:34

Attachments:

Non compiling tests

What steps will reproduce the problem?
1. Run randoop with the command: java -Xmx4G -cp "$cp" randoop.main.Main 
gentests --classlist=<file with list of classes>; (where $cp contains the path 
to jars for junit, randoop and the application being tested)
2. Compile the tests using the command: javac -cp "$cp" Randoop*.java

What is the expected output? What do you see instead?

I see 100 compile errors. All the errors are of the form: method X expects an 
argument of type A (A is a class) but is invoked with an object of type Object.


What version of the product are you using? On what operating system?

I'm using randoop 1.3.2 on Mac OSX Lion (10.7.2)


Please provide any additional information below.

I thought that the feedback-directed technique included the execution of the 
test sequences while they are generated to avoid the generation of sequences 
that would not compile.
Did I miss something the feedback-directed technique or is this a manifestation 
of a bug.

Furthermore I cannot provide the source code I used randoop on because it is 
proprietary.
I would be happy with a simple explanation to what might be going wrong since 
I?m writing a paper about randoop and an extension of it that uses application 
specific contracts and I would like to be able to provide an explanation for 
what I'm observing.

Original issue reported on code.google.com by [email protected] on 23 Jan 2012 at 1:55

Avoid choosing null object as array element

I found randoop may choose new Object[]{null} as the array input even in the 
default mode (forbid_null = true).

This might lead to some failing tests which does not really reveal an error, 
for example:

Arrays.sort(new Integer{null})

will throw an null pointer exception while the input is not null.

The effect could be propagated in a long test generated by randoop. The failed 
assertion at the last may due to an array containing null element at the very 
beginning.

I found this might be a problem, when doing some comparison experiments in the 
last few days.

P.S. I use the randoop 1.3.1 from the download tab.

Original issue reported on code.google.com by [email protected] on 18 Aug 2010 at 2:43

can not find the interface UnaryObjectCheck

What steps will reproduce the problem?

The interface randoop.UnaryObjectCheck to add contracts doesn't exist

What is the expected output? What do you see instead?
I have imported randoop.*;
I got UnaryObjectChecker cannot be resolved to a type

What version of the product are you using? On what operating system?
I'm using randoop1.3.2, on kubuntu, as a eclipse plug-in

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 7 Jul 2011 at 3:03

Running process via ProcessBuilder

An issue was reported against JVM related to Randoop: 
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7184771

It caused trouble with the default 60 seconds processing. I was able to make it 
work setting it to 10 seconds. I believe was a RAM issue.

Original issue reported on code.google.com by [email protected] on 18 Jul 2012 at 1:02

TimeoutExceededException in randoop

In the default mode, randoop creates a thread to execute the generated sequence 
using reflection. If the sequence takes too long time to finish, randoop will 
kill the thread and wrap the  sequence with "Randoop Time out" exception in the 
generated source code.

Therefore, the generated source code might not be compilable unless users 
include the randoop.jar in the classpath. Even if randoop.jar is included, 
re-executing the test will not "reproduce" the exactly exception.

Thus, I suggest to remove the tests with "randoop time out" exception from  
output. Or at least, give users option to choose whether to out them or not.

Original issue reported on code.google.com by [email protected] on 11 Aug 2010 at 1:34

Can I integrate it with Maven?

Is there any plugin for Randoop to run it in Maven build lifecycle? I don't 
want to generate tests manually (from Eclipse). Instead I want Randoop to 
generate them for me automatically on-fly during build "test" phase.

Original issue reported on code.google.com by yegor256 on 9 Mar 2011 at 7:32

Generated tests should not require the Randoop Java agent

The Randoop Java agent

  -javaagent:$(randoop)/randoop_agent.jar=--map_calls=map_calls.txt

is a way of avoiding calls to system routines.

The JUnit tests that are output by Randoop need to be run with that same
javaagent.  It would be better if Randoop's output was self-contained.  To
do so, Randoop should record which tests have their execution detoured by
the javaagent, and should never output such tests.

Original issue reported on code.google.com by [email protected] on 15 Jul 2010 at 11:55

Some tests generated by Randoop do not compile since they contain invalid character literals

What steps will reproduce the problem?

1. Extract the contents of the jar file
2. Copy the generrortests.txt file to the directory where you unarchived the 
jar file.
3. Run the following command 
"java  -Xms1024m -Xmx1024m -ea -classpath <path_to_randoop.jar>:. 
randoop.main.Main gentests --classlist=generrortests.txt --junit-output-dir=uts 
--timelimit=30


What is the expected output? What do you see instead?

Expected output is a lot of tests generated in the uts directory that will 
compile. I see a lot of generated tests but some of them do not compile because 
they have invalid character literals in the generated tests of the form " ' ' ' 
" without an Escape sequence or backslash. The attached errorLog file contains 
the actual compile errors that occur when we compile the generated tests

What version of the product are you using? On what operating system?

I was using Randoop 1.3.2 on my Ubuntu. Got the same error on both Ubuntu and 
Mac OS X 10.6.5


Please provide any additional information below.
The classes.jar are classes generated by compiling Open Source Android code. We 
were trying to run Randoop on Android when we bumped into this issue. I looked 
at the original source in Android and the invalid characters were not present 
in that code.

Original issue reported on code.google.com by [email protected] on 4 Dec 2010 at 8:31

Attachments:

Tests can contain Strings that are too long

Tests can contain String literals that are too long to be compiled. According 
to Section 4.10 of the Java Virtual Machine Specification, the lengths of 
String constants is limited to 65535 bytes.
Randoop generated a test with a longer String, leading to the following error 
when compiling it: "constant string too long"

In my case the erroneous code was produced in 
randoop.util.PrimitiveTypes.toCodeString(). Splitting such Strings into pieces 
of not more than 65535 bytes and concatenating them in the test should solve 
the problem.

Michael

Original issue reported on code.google.com by [email protected] on 17 Jun 2010 at 9:20

can not launch eclipse plugin

What steps will reproduce the problem?
1. Right click -> run as -> Randoop test input 
2. see stacktrace
3.

What is the expected output? What do you see instead?
plugin to start

What version of the product are you using? On what operating system?
latest from repo

Please provide any additional information below.
org.eclipse.core.runtime.AssertionFailedException: assertion failed: 
    at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110)
    at org.eclipse.core.runtime.Assert.isTrue(Assert.java:96)
    at randoop.plugin.internal.ui.launching.RandoopLaunchShortcut.launch(RandoopLaunchShortcut.java:72)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(LaunchShortcutExtension.java:434)
    at org.eclipse.debug.internal.ui.actions.LaunchShortcutAction.run(LaunchShortcutAction.java:73)
    at org.eclipse.debug.internal.ui.actions.LaunchShortcutAction.runWithEvent(LaunchShortcutAction.java:121)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
    at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1267)
    at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1061)
    at org.eclipse.jface.action.ActionContributionItem$9.handleEvent(ActionContributionItem.java:1284)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3540)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3161)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1407)

Original issue reported on code.google.com by [email protected] on 19 Nov 2010 at 10:47

eclipse plugin fails under Java5 (UnsupportedClassVersionError)

What steps will reproduce the problem?
1. install latest plugin 20101122
2. create new workspace with a simple bean
3. try to generate unit tests

What is the expected output? What do you see instead?
to work with java5

What version of the product are you using? On what operating system?
OSX, java5, latest eclipse

Please provide any additional information below.
Plugin is launched, but at generation (after I click on Finish) I'm getting 
UnsupportedClassVersionError (I guess the plugin is also built with Java6)

Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version 
number in .class file
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:676)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:317)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:375)
    at randoop.main.Main.<clinit>(Unknown Source)


Original issue reported on code.google.com by [email protected] on 26 Nov 2010 at 5:10

A likely bug in Randoop, randoop.StatementThrowsException.java

In method toCodeStringPostStatement() ...

It is likely exceptionClassName would be null, if so, the generated code
will lead to a compilation error, like:

catch( null e) {
...
}

A suggested patch (the line with + prefix):

public String toCodeStringPostStatement() {
    StringBuilder b = new StringBuilder();
    String exceptionClassName = exceptionClass.getCanonicalName();
+    if(exceptionClassName == null) {
+       exceptionClassName = "Exception";
+    }
    b.append("  fail(\"Expected exception of type " + exceptionClassName +
"\");" + Globals.lineSep);
    b.append("} catch (");
    b.append(exceptionClassName);
    b.append(" e) {" + Globals.lineSep);
    b.append("  // Expected exception." + Globals.lineSep);
    b.append("}" + Globals.lineSep);
    return b.toString();
  }

Original issue reported on code.google.com by [email protected] on 3 Mar 2010 at 12:50

java.lang.ExceptionInInitializerError & java.lang.Error: classForName

Unit tests are not generated (eclipse plugin 20101204), Randoop fails.

Stack trace in Console window:

Throwable thrown while handling command:java.lang.Error: 
classForName(hu.test.zoli.UtilityTest)
java.lang.Error: classForName(hu.test.zoli.UtilityTest)
    at randoop.util.Reflection.classForName(Unknown Source)
    at randoop.util.Reflection.loadClassesFromList(Unknown Source)
    at randoop.main.GenInputsAbstract.findClassesFromArgs(Unknown Source)
    at randoop.main.GenTests.handle(Unknown Source)
    at randoop.main.Main.nonStaticMain(Unknown Source)
    at randoop.main.Main.main(Unknown Source)
Caused by: java.lang.ExceptionInInitializerError
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:164)
    ... 6 more
Caused by: java.lang.NullPointerException
    at java.util.Hashtable.put(Hashtable.java:396)
    at hu.test.zoli.UtilityTest.<clinit>(UtilityTest.java:11)
    ... 8 more
Randoop failed.
Last sequence under execution:null


I ended up stripping down two real classes to the essential code part that 
fails (see attached).

thanks
Zoli


Original issue reported on code.google.com by [email protected] on 7 Dec 2010 at 1:46

Attachments:

unknown option name '--pretty-print' in arg '--pretty-print=false'

What steps will reproduce the problem?
1. Use the '--pretty-print' option while calling Randoop

What is the expected output? What do you see instead?
Expected: Normal process output
Actual: ERROR: while parsing command-line arguments: unknown option name 
'--pretty-print' in arg '--pretty-print=false

What version of the product are you using? On what operating system?
1.3.2

Please provide any additional information below.
When the errors is shown --pretty-print is not part of the options in the 
output. Either the wiki or the software are incorrect.

Original issue reported on code.google.com by [email protected] on 25 Jul 2012 at 1:50

Set fields as well as calling methods

Each test case generated by Randoop consists of a sequence of method calls.
It would be useful for Randoop to additionally set public variables.  This is 
not necessary if a setter method exists, but it can improve Randoop's coverage 
when no setter method exists.

Original issue reported on code.google.com by [email protected] on 12 Feb 2014 at 9:53

Making NPE checking as optional

Randoop checks several generalized Java object properties and the NPE rule in 
default. However, in my experience, the NPE rule makes too many false alarms on 
both open-source projects and closed-source projects (in Google). 

While most programmers admit that NPE should be wrapped as some high-level 
exceptions, like IllegalArgumentException, they think (1) wrapping NPE as 
high-level exceptions does not make sense in most cases, particularly for 
methods that doesn't carry any state, where incorrect parameters can't "hurt" 
the next invocation, and (2) checking nullability of every reference in the 
code is not realistic for some cases. The checking code will also decrease the 
code readability. Thus, NPE is a free lunch offered by JVM to handle unexpected 
program states.

I suggest Randoop not check the NPE rule as default. Instead, we could add an 
flag to let users choose whether to check NPE or not. We could also dump all 
thrown exceptions of each method after test generation, and let users inspect 
that first. This change might make Randoop more usable.

I made the above changes in my own modified copy of Randoop (as a part of 
another tool): http://code.google.com/p/tpalus/

Original issue reported on code.google.com by [email protected] on 23 Sep 2010 at 9:15

Cannot add System Libraries/Referenced Classpaths before generating unit test

What steps will reproduce the problem?
1. launch Randoop eclipse plugin
2. select Classes Under Test
3. Would like to add some maven dependencies under "Add classes from:"

What is the expected output? What do you see instead?
Click on "Referenced Classpaths...", then select "Maven dependencies", but 
nothing shows up in selection box, there is no way to add any library to 
classpath. 

What version of the product are you using? On what operating system?
randoop plugin 20101204

Please provide any additional information below.
ubuntu 10.10, Sun jdk 1.5, eclipse 3.6.1 EE, maven project

Original issue reported on code.google.com by [email protected] on 6 Dec 2010 at 3:13

[Feature request] fetching public static field declarations from class files

The visible static declared  fields in class files could be useful for 
effective testing. Randoop could add a feature to fetch such declarations for 
sequence generation.

for example:

public class A {

   public static Map m = new Map();

   public static String s = "some value";

}

Randoop could fetch some static declarations into sequence like:

Map x = A.m;
String s = A.s;

and put them into the pool before test gen starts.

To do so, Randoop may need to add a new kind of StatementKind.

Original issue reported on code.google.com by [email protected] on 27 Sep 2010 at 5:28

Randoop terminates when no input generation attempts after 10s

Hi,

I use randoop to generate test for SAT4J 2.1, using the following command:

"gentests", "--classlist=./sat4jexperiment/sat4jclass.txt", "--timelimit=100"

The sat4jclass.txt is attached, which contains all classes on that release.

However, during the test generation phase, randoop detects that there has been 
10s since the last input has generated, so it determines not to generate any 
more.

But it seems that randoop exits in a not so elegant way, it dumps all the error 
trace without writing any tests. I think that need to change.

Exiting randoop when there are no more tests generated is a reasonable idea, 
but randoop should write all generated tests before exit.

here are the output of randoop:



Explorer = randoop.ForwardGenerator@e2cb55

------------------------------------------------------------------------------
                                        Inputs generated  Failing inputs    | 
------------------------------------------------------------------------------
Total                                   0                 0                 | 
Total                                   0                 0                 | 
Total                                   182               5                 | 
Total                                   300               13                | 
Total                                   401               14                | 
restarting 

Total                                   450               17                | 
Total                                   498               18                | 
Total                                   525               19                | 
Total                                   532               19                | 
Total                                   544               19                | 
------------------------------------------------------------------------------
                                        Inputs generated  Failing inputs    | 
------------------------------------------------------------------------------
Total                                   560               19                | 
Total                                   568               19                | 
Total                                   573               19                | 
Total                                   578               19                | 
Total                                   582               19                | 
Total                                   587               19                | 
Total                                   591               19                | 
Total                                   594               19                | 
Total                                   598               19                | 
Total                                   599               19                | 
------------------------------------------------------------------------------
                                        Inputs generated  Failing inputs    | 
------------------------------------------------------------------------------
Total                                   600               20                | 
Total                                   601               20                | 
Total                                   601               20                | 
Total                                   601               20                | 
Total                                   601               20                | 
Total                                   601               20                | 
*** Randoop has detected no input generation attempts after 10000 milliseconds.
This indicates Randoop may be executing an sequence
that leads to nonterminating behavior.
Last sequence generated:

var0 =  cons : org.sat4j.minisat.orders.RandomLiteralSelectionStrategy.<init>() 
: 
var1 =  method : org.sat4j.minisat.SolverFactory.newMiniSATHeap() : 
var2 =  method : org.sat4j.minisat.SolverFactory.newMiniLearningHeapExpSimp() : 
var3 =  method : org.sat4j.minisat.core.Solver.getTimeout() : var2 
var4 =  method : org.sat4j.minisat.SolverFactory.newMiniLearningHeapExpSimp() : 
var5 =  method : org.sat4j.minisat.core.Solver.getTimeout() : var4 
var6 =  method : org.sat4j.minisat.core.Solver.setTimeoutOnConflicts(int) : 
var2 var5 
var7 =  method : org.sat4j.minisat.core.Solver.getOrder() : var2 
var8 =  method : org.sat4j.minisat.core.Solver.toString() : var2 
var9 =  method : org.sat4j.minisat.SolverFactory.newMiniLearningHeapExpSimp() : 
var10 =  method : org.sat4j.minisat.core.Solver.getTimeout() : var9 
var11 =  method : org.sat4j.minisat.SolverFactory.newMiniLearningHeapExpSimp() 
: 
var12 =  method : org.sat4j.minisat.core.Solver.getTimeout() : var11 
var13 =  method : org.sat4j.minisat.core.Solver.setTimeoutOnConflicts(int) : 
var9 var12 
var14 =  method : org.sat4j.minisat.core.Solver.setTimeoutOnConflicts(int) : 
var2 var12 
var15 =  cons : 
org.sat4j.tools.ModelIterator.<init>(org.sat4j.specs.ISolver,int) : var1 var12 
var16 =  prim : int:0 : 
var17 =  method : org.sat4j.minisat.core.Solver.setTimeoutOnConflicts(int) : 
var1 var16 
var18 =  method : 
org.sat4j.minisat.orders.RandomLiteralSelectionStrategy.updateVar(int) : var0 
var16 
var19 =  method : org.sat4j.minisat.SolverFactory.newRelsat() : 
var20 =  method : org.sat4j.tools.RemiUtils.backbone(org.sat4j.specs.ISolver) : 
var19 
var21 =  cons : org.sat4j.reader.LecteurDimacs.<init>(org.sat4j.specs.ISolver) 
: var19 
var22 =  cons : org.sat4j.opt.MaxSatDecorator.<init>(org.sat4j.specs.ISolver) : 
var19 
var23 =  prim : int:100 : 
var24 =  cons : org.sat4j.core.VecInt.<init>(int) : var23 
var25 =  method : org.sat4j.core.VecInt.pop() : var24 
var26 =  method : org.sat4j.minisat.SolverFactory.newMiniLearningHeapExpSimp() 
: 
var27 =  method : org.sat4j.minisat.core.Solver.getTimeout() : var26 
var28 =  method : org.sat4j.minisat.SolverFactory.newMiniLearningHeapExpSimp() 
: 
var29 =  method : org.sat4j.minisat.core.Solver.getTimeout() : var28 
var30 =  method : org.sat4j.minisat.core.Solver.setTimeoutOnConflicts(int) : 
var26 var29 
var31 =  method : org.sat4j.minisat.core.Solver.getOrder() : var26 
var32 =  cons : 
org.sat4j.minisat.orders.RandomWalkDecorator.<init>(org.sat4j.minisat.core.IOrde
r) : var31 
var33 =  method : org.sat4j.minisat.SolverFactory.newMiniLearningHeapExpSimp() 
: 
var34 =  method : org.sat4j.minisat.core.Solver.getTimeout() : var33 
var35 =  method : org.sat4j.minisat.SolverFactory.newMiniLearningHeapExpSimp() 
: 
var36 =  method : org.sat4j.minisat.core.Solver.getTimeout() : var35 
var37 =  method : org.sat4j.minisat.core.Solver.setTimeoutOnConflicts(int) : 
var33 var36 
var38 =  method : org.sat4j.minisat.core.Solver.getOrder() : var33 
var39 =  method : org.sat4j.minisat.core.Solver.toString() : var33 
var40 =  method : org.sat4j.minisat.SolverFactory.newMiniLearningHeapExpSimp() 
: 
var41 =  method : org.sat4j.minisat.core.Solver.getTimeout() : var40 
var42 =  method : org.sat4j.minisat.SolverFactory.newMiniLearningHeapExpSimp() 
: 
var43 =  method : org.sat4j.minisat.core.Solver.getTimeout() : var42 
var44 =  method : org.sat4j.minisat.core.Solver.setTimeoutOnConflicts(int) : 
var40 var43 
var45 =  method : org.sat4j.minisat.core.Solver.setTimeoutOnConflicts(int) : 
var33 var43 
var46 =  prim : long:0 : 
var47 =  method : org.sat4j.minisat.core.Solver.setTimeoutMs(long) : var33 
var46 
var48 =  method : org.sat4j.minisat.core.Solver.newVar() : var33 
var49 =  method : org.sat4j.minisat.orders.RandomWalkDecorator.varActivity(int) 
: var32 var48 
var50 =  method : org.sat4j.core.VecInt.indexOf(int) : var24 var48 
var51 =  method : org.sat4j.opt.MaxSatDecorator.setExpectedNumberOfClauses(int) 
: var22 var48 
var52 =  cons : 
org.sat4j.minisat.orders.NegativeLiteralSelectionStrategy.<init>() : 
var53 =  prim : int:100 : 
var54 =  method : 
org.sat4j.minisat.orders.NegativeLiteralSelectionStrategy.select(int) : var52 
var53 
var55 =  method : 
org.sat4j.minisat.orders.RandomLiteralSelectionStrategy.init(int,int) : var0 
var48 var54 
var56 =  cons : org.sat4j.tools.DimacsStringSolver.<init>(int) : var48 


Will print all thread stack traces and exit with code 1.
--------------------------------------------------
Thread Thread[Timer-210,5,main]
Stack trace:
java.lang.Object.wait(Native Method)
java.util.TimerThread.mainLoop(Timer.java:509)
java.util.TimerThread.run(Timer.java:462)
--------------------------------------------------
Thread Thread[Timer-178,5,main]
Stack trace:
java.lang.Object.wait(Native Method)
java.util.TimerThread.mainLoop(Timer.java:509)
java.util.TimerThread.run(Timer.java:462)
--------------------------------------------------
Thread Thread[Timer-238,5,main]
Stack trace:
java.lang.Object.wait(Native Method)
java.util.TimerThread.mainLoop(Timer.java:509)
java.util.TimerThread.run(Timer.java:462)
--------------------------------------------------
Thread Thread[Timer-231,5,main]
Stack trace:
java.lang.Object.wait(Native Method)
java.util.TimerThread.mainLoop(Timer.java:509)
java.util.TimerThread.run(Timer.java:462)
--------------------------------------------------
Thread Thread[Timer-235,5,main]
Stack trace:
java.lang.Object.wait(Native Method)
java.util.TimerThread.mainLoop(Timer.java:509)
java.util.TimerThread.run(Timer.java:462)
--------------------------------------------------


..... more stack trace dump omitted

Original issue reported on code.google.com by [email protected] on 16 Aug 2010 at 3:46

Visibility of thrown exception in the ExpectedExceptionChecker

Consider the following code snippet:


public class A  {

   public void m() {
     throw new InnerUnvisibleException();
   }

   private static class InnerUnvisibleException extends Exception {
       //omitted
   }

}

Randoop will generate the following (uncompilable) tests:

public void test1() {
   A a = new A();
   try {
      a.m();
      fail("....");
   } catch (A.InnerUnvisibleException e) {  //the exception declaration is not visible
   }
}

A possible but not-so-elegant way is to replace the A.InnerUnvisibleException 
to Exception or the closest exception type...at least, that could be compilable.

Original issue reported on code.google.com by [email protected] on 15 Sep 2010 at 9:24

java.lang.Error: String too long

What steps will reproduce the problem?
1. generate tests with eclipse plugin v. 20101204
2.
3.

Please provide any additional information below.

Throwable thrown while handling command:java.lang.Error: String too long, 
length = 10588java.lang.Error: String too long, length = 10588

    at randoop.util.PrimitiveTypes.toCodeString(Unknown Source)
    at randoop.PrimValue.toCodeString(Unknown Source)
    at randoop.ObjectCheck.toCodeStringPostStatement(Unknown Source)
    at randoop.ExecutableSequence.toCodeString(Unknown Source)
    at randoop.JunitFileWriter.writeSubSuite(Unknown Source)
    at randoop.JunitFileWriter.createJunitTestFiles(Unknown Source)
    at randoop.JunitFileWriter.createJunitTestFiles(Unknown Source)
    at randoop.main.GenTests.write_junit_tests(Unknown Source)
    at randoop.main.GenTests.handle(Unknown Source)
    at randoop.main.Main.nonStaticMain(Unknown Source)
    at randoop.main.Main.main(Unknown Source)
Randoop failed.

Original issue reported on code.google.com by [email protected] on 6 Dec 2010 at 4:07

Can not build randoop with java5

What steps will reproduce the problem?
1. Build plume-lib with java5
2. replace lib/plume.jar with the one that is compiled with java5
3. make all (in randoop)

What is the expected output? What do you see instead?
to be able to build with jdk5

What version of the product are you using? On what operating system?
latest source from repo

Please provide any additional information below.
zoli@zoli-laptop:~/workspace_randoop/randoop$ java -version
java version "1.5.0_19"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_19-b02)
Java HotSpot(TM) Server VM (build 1.5.0_19-b02, mixed mode)
zoli@zoli-laptop:~/workspace_randoop/randoop$ make clean
rm -rf bin
zoli@zoli-laptop:~/workspace_randoop/randoop$ make all
rm -rf bin
mkdir -p bin
javac -Xlint -Xlint:unchecked -g -d bin ...
src/randoop/MultiVisitor.java:34: method does not override a method from its 
superclass
  @Override
   ^
src/randoop/ObjectCheck.java:81: method does not override a method from its 
superclass
  @Override
   ^
src/randoop/ObjectCheck.java:95: method does not override a method from its 
superclass
  @Override
   ^
src/randoop/ObjectCheck.java:110: method does not override a method from its 
superclass
  @Override
   ^
src/randoop/ObjectCheck.java:122: method does not override a method from its 
superclass
  @Override
   ^
src/randoop/ObjectCheck.java:127: method does not override a method from its 
superclass
  @Override
   ^
....

src/randoop/IsNull.java:60: method does not override a method from its 
superclass
  @Override
   ^
src/randoop/IsNull.java:65: method does not override a method from its 
superclass
  @Override
   ^
81 errors
make: *** [bin] Error 1
zoli@zoli-laptop:~/workspace_randoop/randoop$ 


Original issue reported on code.google.com by [email protected] on 25 Nov 2010 at 8:50

Generated tests use protected inner classes as a type

The generated tests use a protected abstract static class (which is defined
inside one of the classes under test) as a type. Since the protected class
cannot be accessed from the test cases, compiling them fails.

Protected inner classes should not be referenced in the generated test cases.

I'm using Randoop 1.3.1.

Thanks

Original issue reported on code.google.com by [email protected] on 4 Jun 2010 at 7:08

Failed generated tests not saved in output folder

What steps will reproduce the problem?
1. generate randoop unit tests with eclipse plugin
2. I have a maven project
3.

What is the expected output? What do you see instead?
under /src/test/java to have the randoop generated unit tests

What version of the product are you using? On what operating system?
20101204 plugin

Please provide any additional information below.

I have 1409 generated tests, 1 failure.
In the Randoop View I see "NPEs / AssertionViolation"

then in the ErrorLog View I see :
The JUnit test file 
/home/zoli/workspace/SOADefinitionsBase/src/test/java/randoopFailures/RandoopTes
t_failure_1.java is not in the project for which it was generated (code 10000).

Exception stack trace:
An exception stack trace is not available.

Original issue reported on code.google.com by [email protected] on 6 Dec 2010 at 3:39

Why the new randoop produces much less tests than the old one?

Hi all:

I am using both old and new version of randoop
(http://people.csail.mit.edu/cpacheco/randoop/1.2/doc/index.php) for
generating tests, but find the new version generates significant less tests
within the same amount of time.

I use the TreeMap benchmark, and run both randoop versions with the
following argument:

gentest
--testclass=TreeMap
--limit=10

As a result, old randoop generates  8354 tests in 10 seconds, while the new
randoop generates only 586 tests in 10 seconds.

I also attached generated tests in this thread.

I am curious is that any big changes in the new randoop code? or did it add
some new features? (at least I did not note that from the generated tests)

Thanks

-Sai Zhang















Original issue reported on code.google.com by [email protected] on 26 Feb 2010 at 10:56

Attachments:

A bug in randoop, PrimitiveTypes.java, line 173, 191

File randoop.PrimitiveTypes.java

Line 173, 191

Here is the original code:
rep = rep + "d";


However, you need to first check whether rep is NaN or INFINITE, if so, it
 makes no sense to add a "d", i.e, Double.NaNd will lead to a compiler error. 

A suggested patch:

if(!d.isNaN() && d != Double.POSITIVE_INFINITY && d !=
Double.NEGATIVE_INFINITY) {
        rep = rep + "d";
      }

Thanks


Original issue reported on code.google.com by [email protected] on 3 Mar 2010 at 12:47

can't use @CheckRep

What steps will reproduce the problem?
1.download eclipse Helios for Java Developers
2. install plugin randoop
3. create project with method repOk and add @CheckRep comment in the top
4. import randoop.*

What is the expected output? What do you see instead?

eclipse don't find randoop
and I can't use @CheckRep
but if I quit @CheckRep the tests are generated well.

What version of the product are you using? On what operating system?
  Randoop Core/UI   0.1.0.201107281327  randoop.feature.group
  Eclipse IDE for Java Developers   1.3.2.20110218-0812 epp.package.java




Original issue reported on code.google.com by [email protected] on 24 Jan 2014 at 12:12

eclipse plugin fails under maven2

What steps will reproduce the problem?
1. use a project that uses maven
2. use the plugin to generate unit tests
3.

What is the expected output? What do you see instead?
test cases are generated under /src/test/java

What version of the product are you using? On what operating system?
latest from repo

Please provide any additional information below.
With a maven project there are several sources:
myproject/src/main/java
myproject/src/main/resources
myproject/src/test/java  (here I already have some manual test cases and would 
expect that new ones will be generated here)
myproject/src/test/resources

With the plugin when I select output folder, I select /src/test/java, but in 
the selection box, it only appears "java". After clicking on "Finish", unit 
tests are not generated and in my project's sources list the "/java" folder is 
added (as the fifth source). 

Thanks
Zoltan



Original issue reported on code.google.com by [email protected] on 2 Dec 2010 at 4:48

Crash while generating serialized tests

What steps will reproduce the problem?
1. Download the org.apache.commons.collections package
2. Test the package (a list with all package classes provided with the 
--classlist parameter) with option --output-tests-serialized=randoop-tests.gz
3. Observe Randoop exiting with a Throwable thrown


What is the expected output? What do you see instead?

I expect to have tests in a file randoop-tests.gz and Randoop exiting normally. 
Instead, Randoop crashes with an error message attached.


What version of the product are you using? On what operating system?

Randoop 1.3.3. The operating system is GNU/Linux Trisquel 6.0.


Please provide any additional information below.

This is the command that I used to run Randoop:

java $JVM_FLAGS -ea -cp lib/randoop.jar:lib/junit4.jar:../examples/ 
randoop.main.Main gentests --classlist=classlist.txt 
--junit-output-dir=tests-round-1/ --junit-classname=Randoop1Test --timelimit=30 
--forbid-null=false --small-tests=true --testsperfile=1 
--check-object-contracts=false

File classlist.txt is attached.

Original issue reported on code.google.com by [email protected] on 18 Nov 2013 at 6:31

Attachments:

Resulting JUnit execution reports duplicate failures for same test case

What steps will reproduce the problem?
1. Generate Suite where all test cases pass.
2. Insert one failure by changing a text value that will always be false.
3. Run JUnit

What is the expected output? What do you see instead?
I expect to see a report of a single failure, instead I see two failures and I 
am not sure why. I don't expect duplicate failures, but perhaps I am not 
running the plugin in correctly?


What version of the product are you using? On what operating system?
Windows 7, Eclipse/ADT, Randoop version installed recently.


Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 21 Oct 2014 at 4:45

No randoop_agent.jar in the download tab.

at least for the latest release 1.3.1, there is no such jar included (nor there 
is corresponding META-INF file)

I think that should be added, instead of letting users build it from source.

Original issue reported on code.google.com by [email protected] on 14 Aug 2010 at 4:28

Problem of compiling randoop tests

I define a class Pile which extends Vector<Something>

I generate tests with Randoop, it is ok, it executes

But Randoop generates some tests which cannot compile and I do not see
what I can do (importing, redefining methods, ...)

Example of problem 

public void test4() throws Throwable {

    if (debug) System.out.printf("%nRandoopTest0.test4");


    src.Pile var0 = new src.Pile();
    int var3 = var0.indexOf((java.lang.Object)(byte)0, 10);
    boolean var5 = var0.equals((java.lang.Object)0.0f);
    var0.addElement((java.lang.Object)false);
    int var9 = var0.lastIndexOf((java.lang.Object)(short)10);
    int var12 = var0.lastIndexOf((java.lang.Object)100.0d, 0);

    // Regression assertion (captures the current behavior of the code)
    assertTrue(var3 == (-1));

    // Regression assertion (captures the current behavior of the code)
    assertTrue(var5 == false);

    // Regression assertion (captures the current behavior of the code)
    assertTrue(var9 == (-1));

    // Regression assertion (captures the current behavior of the code)
    assertTrue(var12 == (-1));

  }

The line var0.addElement((java.lang.Object)false); 
does not compile since var0 is a Vector<Something> and do not accept an Object.
Where is my mistake ? What I can do

However it works well if I use aggregation rather than inheritance.

Original issue reported on code.google.com by [email protected] on 30 Apr 2013 at 2:26

Choose literals more intelligently (e.g., from literals in source code)

Literals in source code are a good choice for values.
Randoop could create better tests, that exercise more functionality, if it
tried string literals from the source code in addition to values like null,
"", and "hi".

Feature request:  enable Randoop to use string literals from the source
code when generating tests.  Alternately (or in addition), enable it to
read literals from an external file; this would permit a user to extract
strings from source code or from elsewhere.

Original issue reported on code.google.com by [email protected] on 5 Mar 2010 at 6:44

package randoop.util.ReflectionExecutor does not exist

What steps will reproduce the problem?
1. Run Randoop and generated tests
2. Try and compile generated Junit tests
3.

What is the expected output? What do you see instead?
 ./RandoopTest1.java:6070: package randoop.util.ReflectionExecutor does not exist
    } catch (randoop.util.ReflectionExecutor.TimeoutExceeded e) {
                                            ^
./RandoopTest1.java:6719: package randoop.util.ReflectionExecutor does not exist
    } catch (randoop.util.ReflectionExecutor.TimeoutExceeded e) {
                                            ^
./RandoopTest1.java:8083: package randoop.util.ReflectionExecutor does not exist
    } catch (randoop.util.ReflectionExecutor.TimeoutExceeded e) {
...

What version of the product are you using? On what operating system?
Randoop-1.3.2.jar
Linux - 2.6.34-gentoo-r6 x86_64
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.1) (Gentoo build 1.6.0_20-b20)
OpenJDK 64-Bit Server VM (build 19.0-b06, mixed mode)

Please provide any additional information below.
This could be a classpath issue, and I tried including the classpath of the 
actual class in the source - bin/randoop/util/ReflectionExecutor.class

Original issue reported on code.google.com by [email protected] on 7 Dec 2010 at 3:07

Randoop throws AssertionError for a math package

What steps will reproduce the problem?
1. Download the org.apache.commons.math3 package
2. Test the package (a list with all package classes provided with the 
--classlist parameter)
3. Observer Randoop exiting with an assertion error

What is the expected output? What do you see instead?

The expected output should be without exceptions, resulting in Randoop writing 
generated unit tests to the file system.

Instead I get the following:

Creating Junit tests (2236 tests)...Throwable thrown while handling 
command:java.lang.AssertionError
java.lang.AssertionError
        at randoop.main.GenTests.handle(GenTests.java:529)
        at randoop.main.Main.nonStaticMain(Main.java:80)
        at randoop.main.Main.main(Main.java:42)
Randoop failed.
Last sequence under execution:var0 =  prim : int:1079574528 : 
var1 =  prim : boolean:true : 
var2 =  cons : 
org.apache.commons.math3.stat.regression.MillerUpdatingRegression.<init>(int,boo
lean) : var0 var1

What version of the product are you using? On what operating system?

Randoop 1.3.3. The operating system is GNU/Linux Trisquel 6.0.

Please provide any additional information below.

This is the command that I used to run Randoop:

java $JVM_FLAGS -ea -cp lib/randoop.jar:lib/junit4.jar:../src/ 
randoop.main.Main gentests --classlist=classlist.txt 
--junit-output-dir=tests-round-1/ --junit-classname=Randoop1Test --timelimit=60 
--forbid-null=false --small-tests=true --testsperfile=1

Original issue reported on code.google.com by [email protected] on 29 Aug 2013 at 12:07

Randoop outputs Double.NaN, Float.NaN regression assertions that fail

When creating a regression check over Float.NaN and Double.NaN, Randoop 
generates assertions like

  // Regression assertion (captures the current behavior of the code)
    assertTrue(var6 == Double.NaN);

This is incorrect, because using == on two NaN values always returns false. A 
corrected version of the above assertion is:

  // Regression assertion (captures the current behavior of the code)
    assertEquals(var6, Double.valueOf(Double.NaN));

Original issue reported on code.google.com by [email protected] on 16 Aug 2010 at 1:41

eclipse plugin fails under Java5 (UnsupportedClassVersionError)

What steps will reproduce the problem?
1. install latest plugin 20101122
2. create new workspace with a simple bean
3. try to generate unit tests

What is the expected output? What do you see instead?
to work with java5

What version of the product are you using? On what operating system?
OSX, java5, latest eclipse

Please provide any additional information below.
Plugin is launched, but at generation (after I click on Finish) I'm getting 
UnsupportedClassVersionError (I guess the plugin is also built with Java6)

Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version 
number in .class file
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:676)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:317)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:375)
    at randoop.main.Main.<clinit>(Unknown Source)


Original issue reported on code.google.com by [email protected] on 26 Nov 2010 at 5:13

  • Merged into: #24

Seems that Randoop does not support enum type

A simple example:

public enum Currency {
   USD, CAD, CNY
}

public class WorldMoney {
  public int convert (int amount, Currency currency) {
    // body omit here
 }
}

The convert(amount, currency) method will never be called by Randoop, due to 
the missing of Currency type.


Original issue reported on code.google.com by [email protected] on 9 Sep 2010 at 1:58

test review functionality

Purpose of code changes on this branch:


When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk


Original issue reported on code.google.com by [email protected] on 21 Sep 2010 at 11:44

A likely randoop bug which leads to uncompilable tests

//I test on the  randoop releases on the Downloads tab, but did not try on the 
latest code in the repository.


Consider the following simple example. Use command:
"gentests --testclass=bug.NonVisible --testclass=bug.BugClass --timelimit"
to generate test.

Randoop will generate several uncompilable tests, because the NonVisible class 
is only package visible. Though randoop has automatically prune out all 
non-public class/method by default, it may call a public method which returns a 
non-public class object (like the following example).

This may not be a good programming practice, but does exist in some real world 
open source projects.

There could be several ways to correct this bug:
1) check the visibility of return, parameter types of a public call. If it 
involves some nonvisible class, randoop should avoid call it.
2) if a public method returns a non-visible class object, randoop should avoid 
use its return value.


BugClass.java

/**
 * Two classes in the same file
*/

package bug;

class NonVisible {
  public void randoopOmittedMethod() {};
}

public class BugClass {
  public NonVisible getNonVisible() {
    return new NonVisible();
  }  
  public void eatNonVisible(NonVisible nonVisible) {

  }
}


Original issue reported on code.google.com by [email protected] on 5 Aug 2010 at 5:59

randoop eclipse plugin generated pritnf statement is giving compilation error

What steps will reproduce the problem?
1.Generate tests using randoop eclipse plugin with default setting.
2.
3.

What is the expected output? What do you see instead?
Test are generated perfectly except one issue. each test method has following 
line 
"if (debug) System.out.printf("%nRandoopTest11.test1");"
above line is giving compilation error as printf requires two parameters.
for running these test sucessfully i have to manually comment or remove those 
lines. that is not possible in real scenario because there are  hundreds or 
thousands of tests method. How can i suppress these debug condition generation 
or make any changes in it.

What version of the product are you using? On what operating system?
Eclipse plugin- Randoop Core/UI -0.1.0.201012040011 - randoop.feature.group

Please provide any additional information below.



Original issue reported on code.google.com by [email protected] on 22 Dec 2010 at 6:02

Maven Plug-in

I have a plug-in already working but want to add more stuff to it: 
https://bitbucket.org/javydreamercsw/randoop-maven-plugin

I have some questions/issues:
1) I would need Randoop in Maven repository. I can do it myself but I guess you 
would like to have control over that.
2) I would like to add some of your guys to have to my bitbucket repo so they 
can contribute.
3) Do you have a place to host the Maven site that I'll generate for it?

Original issue reported on code.google.com by [email protected] on 29 Nov 2012 at 3:47

The potentially nondeterministic output by randoop

Though the latest release of Randoop has made significant efforts in 
eliminating the non-determinism in the output test, it still produces some 
tricky nondeterminism.

e.g.

var18 = var16.values();

assertTrue("'" + var18 + "' != '" + "[]=[Ljava.lang.Object;@1a83126"+ "'", 
var18.equals("[]=[Ljava.lang.Object;@1a83126"));

Acutally, var16.values() will transitively call the Object.toString() method, 
thus, produces some non-repeatable object identity.

I think we could employ some heuristic to further reduce some nondeterminism, 
such as observinig the output string using patterns like "type@object id" to 
check whether it is a non-deterministic output.

Original issue reported on code.google.com by [email protected] on 17 Aug 2010 at 6:26

no sequences given to createJunitFiles

What steps will reproduce the problem?
1.Generating tests
2.java -classpath randoop.1.3.3.jar randoop.main.Main gentests 
--classlist=myclasses.txt --timelimit=60
3.

What is the expected output? What do you see instead?
 files containing the tests 

What version of the product are you using? On what operating system?
randoop.1.3.3, Windows 7 

Please provide any additional information below.
It says there is no sequences given to createJunitFiles

Original issue reported on code.google.com by [email protected] on 20 Mar 2013 at 7:22

Attachments:

Create An Intellij IDEA Plugin

I avoid eclipse like the plague but would rather not have to run Randoop from the command line.
Can you make an Intellij IDEA plugin please?

A class under test using System.exit() terminates Randoop

Generating test cases for a class such as the following terminates Randoop 
without any warning and without any generated tests:

public class Killer {
    public void m() {
        System.exit(1);
    }
}

Of course, that's a contrived example, but real programs sometimes use 
System.exit() and whenever Randoop hits it, test case generation is stopped. 

I don't see an elegant fix for this issue. Maybe one could scan for calls to 
System.exit and skip such methods altogether.

Original issue reported on code.google.com by [email protected] on 14 Jun 2010 at 11:58

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.