Class SmallTestsSequenceSelection


  • public class SmallTestsSequenceSelection
    extends InputSequenceSelector
    Select input sequences, favoring shorter sequences. This makes Randoop produce smaller JUnit tests.
    • Field Detail

      • weightMap

        private final Map<Sequence,​Double> weightMap
        Map from a sequence to its weight.
    • Constructor Detail

      • SmallTestsSequenceSelection

        public SmallTestsSequenceSelection()
    • Method Detail

      • selectInputSequence

        public Sequence selectInputSequence​(SimpleList<Sequence> candidates)
        Pick a sequence from the candidate list using a weighting that favors shorter sequences.
        Specified by:
        selectInputSequence in class InputSequenceSelector
        Parameters:
        candidates - sequences to choose from
        Returns:
        the chosen sequence
      • updateWeightMapForCandidates

        private double updateWeightMapForCandidates​(SimpleList<Sequence> candidates)
        Update the weight for any sequence not currently in the map, and compute the total weight.
        Parameters:
        candidates - the elements to compute a weight for
        Returns:
        the total weight of all the candidates