0

I'm using Android Studio on Windows 10 to develop a Java Android app; I need to use Randoop for automatic test generation but I'm having some problems, so here are my questions:

  1. I don't have the files *.class of my project, I only have *.java files: does it need to have *.class files? If it is the case, how do I compile a java project with different packages in it (so the classes are in different folders e most of them have "import ..." statements)? What if there are errors? Does it mean that randoop only works for projects builded without errors?
  2. I want to generate tests for all the classes in my project, so I specify the command gentests --classlist=myclasses.txt where the "myclasses.txt" file contains the name of the classes I want to generate the tests; how do I need to write the name of the classes in which I'm interested of generating the tests? Is it the classpath, or the name is enough provided that the class is in the same directory as the Randoop jar "randoop-all-4.1.0.jar" directory?
  3. Is there a way to generate tests directly into the project so that when I open up Android Studio I can see them in a specified folder in the project-files tree?

I'm asking these questions mainly because Randoop can't find the classes for which I want the tests.

Ivan
  • 1
  • 1
  • 8

1 Answers1

0

All of your questions are answered in existing documentation.

how do I compile a java project with different packages in it

A web search for that exact text led to this Stack Overflow answer: Compiling multiple packages using the command line in Java

--classlist=myclasses.txt ... how do I need to write the name of the classes

The Randoop Manual documentation for --classlist says: "In the file, each class under test is specified by its fully-qualified name on a separate line. See an example."

Is there a way to generate tests directly into the project

Use Randoop's --junit-output-dir command-line argument.

mernst
  • 7,437
  • 30
  • 45