1

I am actually trying to Run Randoop for my project. The name of the test classes that it generates are like RandoopTest*

I know the argument --junit-classname will set the base classname instead of RandoopTest.

But I would like to have the test class name with something related to my Class like MyClassTest. Is there a way to do it?

Konstantin V. Salikhov
  • 4,554
  • 2
  • 35
  • 48
Praveen Kumar
  • 977
  • 3
  • 12
  • 26
  • When I run Randoop, the --junit-classname command-line argument affects the names of all the generated Java files. Are you talking about something else? Maybe giving a more specific example of what you are doing and the problem would be helpful. – mernst Jul 02 '15 at 11:24
  • Consider I have two classes like ClassOne and ClassTwo and randoop creates test classes like RandoopTest0, RandoopTetst1 etc. But I want the test classes to be like ClassOneTest and ClassTwoTest. Is this possible? – Praveen Kumar Jul 02 '15 at 13:04

1 Answers1

0

Randoop makes tests for all of the classes that you pass to it. Thus, a single test might call a method from ClassOne, then call nine methods from ClassTwo, then call another method from ClassOne. It's unclear whether you would want this test to appear in ClassOneTest or ClassTwoTest.

If you want to test only methods from ClassOne, then you can inform Randoop to do that. However, if you direct Randoop to test both ClassOne and ClassTwo, then every test may involve both classes and it doesn't make sense to divide Randoop's output into the "ClassOne tests" and the "ClassTwo tests".

mernst
  • 7,437
  • 30
  • 45
  • Thanks :) But I feel by this way readability is little compromised. It would have been great had there been a facility for the segregation based on the classes. – Praveen Kumar Jul 02 '15 at 13:49
  • You could implement this if you wanted to; Randoop is open-source. I'm not sure how you want to segregate the tests, though. I gave an example of a test that calls methods from two classes; I'm not sure what category you would want to put that in. – mernst Jul 02 '15 at 20:17