randoop.main
Class GenInputsAbstract

Object
  extended by CommandHandler
      extended by GenInputsAbstract
Direct Known Subclasses:
GenTests

public abstract class GenInputsAbstract
extends CommandHandler

Container for Randoop options.


Nested Class Summary
Modifier and Type Class and Description
static class GenInputsAbstract.ClassLiteralsMode
           
 
Field Summary
Modifier and Type Field and Description
static String agent
           
static double alias_ratio
          Try to reuse values from a sequence with the given frequency.
static String all
           
static boolean always_use_ints_as_objects
           
static boolean capture_output
           
static boolean check_object_contracts
          Use Randoop's default set of object contracts.
static String classlist
          The name of a file that lists classes under test.
static File clean_checks
           
static int clear
          Clear the component set each time it reaches inputs.
static int comm_port
           
static boolean compare_checks
          Run each test twice and compare the checks.
static List<String> componentfile_ser
           
static List<String> componentfile_txt
           
static String coverage_instrumented_classes
           
static boolean debug_checks
           
static boolean dont_output_tests
           
static boolean dontexecute
          Create sequences but never execute them.
static FileWriter expfile
           
static String fail
           
static boolean forbid_null
          Never use null as input to methods or constructors.
static String init_routine
           
static int inputlimit
          Maximum number of tests generated.
static String junit_classname
          Base name (no ".java" suffix) of the JUnit file containing Randoop-generated tests
static String junit_output_dir
          Name of the directory to which JUnit files should be written
static String junit_package_name
          Name of the package for the generated JUnit files
static List<String> literals_file
          A file containing literal values to be used as inputs to methods under test.
static GenInputsAbstract.ClassLiteralsMode literals_level
          How to use literal values (see --literals-file): ALL, PACKAGE, CLASS, or NONE.
static FileWriter log
          Name of a file to which to log lots of information.
static boolean long_format
           
static int maxsize
          Do not generate tests with more than this many statements
static int mem_megabytes
           
static String methodlist
          The name of a file that lists methods under test.
static boolean noprogressdisplay
           
static double null_ratio
          Use null with the given frequency.
static File observers
           
static boolean offline
           
static Pattern omitmethods
          Randoop will not attempt to directly call methods whose Method.toString() matches the regular expression given.
static String output_branches
           
static String output_components
          Output components (serialized, GZIPPED) to the given file.
static boolean output_cov_witnesses
           
static String output_covmap
           
static boolean output_nonexec
          Output sequences even if they do not complete execution.
static String output_tests
           
static String output_tests_serialized
          Output tests (sequences plus checkers) in serialized form to the given file.
static int outputlimit
          Determines the maximum number of tests to output, no matter how many are generated.
static String pass
           
static boolean print_diff_obs
           
static long progressinterval
           
static boolean public_only
          If the command line argument public_only is true, only public classes/methods are considered visible.
static int randomseed
           
static boolean remove_subsequences
           
static boolean repeat_heuristic
           
static boolean silently_ignore_bad_class_names
           
static boolean small_tests
          Favor shorter sequences when assembling new sequences out of old ones.
static int string_maxlen
           
static List<String> system_props
           
static Pattern test_classes
           
static List<String> testclass
           
static int testsperfile
          Maximum number of tests to write to each JUnit file
static int timelimit
           
static boolean use_object_cache
           
static List<String> visitor
           
 
Fields inherited from class CommandHandler
fcommand, fcommandGrammar, fexample, finput, fnotes, foptions, foutput, fpitch, fsummary, fwhere
 
Constructor Summary
Constructor and Description
GenInputsAbstract(String command, String pitch, String commandGrammar, String where, String summary, List<String> notes, String input, String output, String example, Options options)
           
 
Method Summary
Modifier and Type Method and Description
 void checkOptionsValid()
          Check that the options given satisfy any specified constraints, and fail if they do not.
 
Methods inherited from class CommandHandler
handle, handles, printHTML, usageMessage
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

testclass

public static List<String> testclass

classlist

public static String classlist
The name of a file that lists classes under test. In the file, each class under test is specified by its fully qualified name on a separate line.


methodlist

public static String methodlist
The name of a file that lists methods under test. In the file, each each method under test is specified on a separate line. The list of methods given by this argument will agument any methods derived via the --classlist option. Also see section on specifying methods and constructors under test.


omitmethods

public static Pattern omitmethods
Randoop will not attempt to directly call methods whose Method.toString() matches the regular expression given. This does not prevent indirect calls to such methods from other, allowed methods.


public_only

public static boolean public_only
If the command line argument public_only is true, only public classes/methods are considered visible. If public_only is false then any class/method that is not private is considered visible. FIXME: This option outputs tests that do not compile. Until a fix is done, keep the option @Unpublicized. The option should probably be an enum with PUBLIC, PACKAGE, PUBLIC elements.


init_routine

public static String init_routine

silently_ignore_bad_class_names

public static boolean silently_ignore_bad_class_names

literals_level

public static GenInputsAbstract.ClassLiteralsMode literals_level
How to use literal values (see --literals-file): ALL, PACKAGE, CLASS, or NONE.


literals_file

public static List<String> literals_file
A file containing literal values to be used as inputs to methods under test. Literals in these files are used in addition to all other constants in the pool. May be specified multiple times. For the format of this file, see documentation in class LiteralFileReader. The special value "CLASSES" (with no quotes) means to read literals from all classes under test.


randomseed

public static int randomseed

timelimit

public static int timelimit

inputlimit

public static int inputlimit
Maximum number of tests generated. Used to determine when to stop test generation. Generation stops when either the time limit (--timelimit=int) OR the input limit (--inputlimit=int) is reached. The number of tests output may be smaller than then number of inputs created, because redundant and illegal inputs may be discarded. Also see --outputlimit.


outputlimit

public static int outputlimit
Determines the maximum number of tests to output, no matter how many are generated. Contrast to --inputlimit.


maxsize

public static int maxsize
Do not generate tests with more than this many statements


forbid_null

public static boolean forbid_null
Never use null as input to methods or constructors. This option causes Randoop to abandon the method call rather than providing null as an input, when no non-null value of the appropriate type is available. To ask Randoop to calls methods with null with greater frequency, see option --null-ratio.


string_maxlen

public static int string_maxlen

null_ratio

public static double null_ratio
Use null with the given frequency. If a null ratio is given, it should be between 0 and 1. A ratio of X means that null will be used instead of a non-null value as a parameter to method calls, with X frequency (1 means always use null, 0 means never use null). For example, a ratio of 0.5 directs Randoop to use null inputs 50 percent of the time. Randoop never uses null for receiver values.


alias_ratio

public static double alias_ratio
Try to reuse values from a sequence with the given frequency. If an alias ratio is given, it should be between 0 and 1. A ratio of 0 results in tests where each value created within a test input is typically used at most once as an argument in a method call. A ratio of 1 tries to maximize the number of times values are used as inputs to parameters within a test.


small_tests

public static boolean small_tests
Favor shorter sequences when assembling new sequences out of old ones. Randoop generate new tests by combining old previously-generated tests. If this option is given, tests with fewer calls are given greater weight during its random selection. This has the overall effect of producing smaller JUnit tests.


clear

public static int clear
Clear the component set each time it reaches inputs. Randoop stores previously-generated tests in a "component" set, and uses them to generate new tests. Setting this variable to a small number can sometimes result in a greater variety of tests generated during a single run.


observers

public static File observers

check_object_contracts

public static boolean check_object_contracts
Use Randoop's default set of object contracts. By default, Randoop checks a set of contracts, e.g. equals(Object) is reflexive, equals(null) returns false, no NullPointerExceptions, no AssertionErrors, etc.


output_tests

public static String output_tests

all

public static final String all
See Also:
Constant Field Values

fail

public static final String fail
See Also:
Constant Field Values

pass

public static final String pass
See Also:
Constant Field Values

testsperfile

public static int testsperfile
Maximum number of tests to write to each JUnit file


junit_classname

public static String junit_classname
Base name (no ".java" suffix) of the JUnit file containing Randoop-generated tests


junit_package_name

public static String junit_package_name
Name of the package for the generated JUnit files


junit_output_dir

public static String junit_output_dir
Name of the directory to which JUnit files should be written


dont_output_tests

public static boolean dont_output_tests

output_nonexec

public static boolean output_nonexec
Output sequences even if they do not complete execution. Randoop's default behavior is to output only tests consisting of method call sequences that execute to the end, rather than throwing an exception or failing a contract check in the middle of execution.


test_classes

public static Pattern test_classes

system_props

public static List<String> system_props

agent

public static String agent

mem_megabytes

public static int mem_megabytes

capture_output

public static boolean capture_output

componentfile_ser

public static List<String> componentfile_ser

componentfile_txt

public static List<String> componentfile_txt

output_components

public static String output_components
Output components (serialized, GZIPPED) to the given file. Suggestion: use a .gz suffix in file name.


output_tests_serialized

public static String output_tests_serialized
Output tests (sequences plus checkers) in serialized form to the given file. Suggestion: use a .gz suffix in file name.


comm_port

public static int comm_port

noprogressdisplay

public static boolean noprogressdisplay

progressinterval

public static long progressinterval

visitor

public static List<String> visitor

debug_checks

public static boolean debug_checks

log

public static FileWriter log
Name of a file to which to log lots of information. If not specified, no logging is done.


dontexecute

public static boolean dontexecute
Create sequences but never execute them. Used to test performance of Randoop's sequence generation code.


long_format

public static boolean long_format

output_covmap

public static String output_covmap

output_cov_witnesses

public static boolean output_cov_witnesses

always_use_ints_as_objects

public static boolean always_use_ints_as_objects

coverage_instrumented_classes

public static String coverage_instrumented_classes

output_branches

public static String output_branches

remove_subsequences

public static boolean remove_subsequences

compare_checks

public static boolean compare_checks
Run each test twice and compare the checks. If the results differ, then disable the test.


clean_checks

public static File clean_checks

print_diff_obs

public static boolean print_diff_obs

expfile

public static FileWriter expfile

offline

public static boolean offline

repeat_heuristic

public static boolean repeat_heuristic

use_object_cache

public static boolean use_object_cache
Constructor Detail

GenInputsAbstract

public GenInputsAbstract(String command,
                         String pitch,
                         String commandGrammar,
                         String where,
                         String summary,
                         List<String> notes,
                         String input,
                         String output,
                         String example,
                         Options options)
Method Detail

checkOptionsValid

public void checkOptionsValid()
Check that the options given satisfy any specified constraints, and fail if they do not.