Package randoop.generation
Class UniformRandomMethodSelection
- java.lang.Object
-
- randoop.generation.UniformRandomMethodSelection
-
- All Implemented Interfaces:
TypedOperationSelector
public class UniformRandomMethodSelection extends Object implements TypedOperationSelector
This class selects a method, from the list of methods under test, with uniform probability.
-
-
Field Summary
Fields Modifier and Type Field Description private List<TypedOperation>
operations
The list of methods under test.
-
Constructor Summary
Constructors Constructor Description UniformRandomMethodSelection(List<TypedOperation> operations)
Create a selector that selects uniformly at random from the given operations.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
newRegressionTestHook(Sequence sequence)
Does nothing.TypedOperation
selectOperation()
Selects an operation with uniform random probability.
-
-
-
Field Detail
-
operations
private final List<TypedOperation> operations
The list of methods under test. We will select uniformly at random from this list.
-
-
Constructor Detail
-
UniformRandomMethodSelection
public UniformRandomMethodSelection(List<TypedOperation> operations)
Create a selector that selects uniformly at random from the given operations.- Parameters:
operations
- methods under test
-
-
Method Detail
-
selectOperation
public TypedOperation selectOperation()
Selects an operation with uniform random probability.- Specified by:
selectOperation
in interfaceTypedOperationSelector
- Returns:
- a random operation
-
newRegressionTestHook
public void newRegressionTestHook(Sequence sequence)
Does nothing. This selection strategy does not need to make use of information related to the newly-generated sequence that was classified as a regression test.- Specified by:
newRegressionTestHook
in interfaceTypedOperationSelector
- Parameters:
sequence
- newly-created sequence that was classified as a regression test
-
-