Class RandomWpMethodEQOracle<A extends UniversalDeterministicAutomaton<?,​I,​?,​?,​?> & Output<I,​D>,​I,​D>

  • Type Parameters:
    A - automaton type
    I - input symbol type
    D - output domain type
    All Implemented Interfaces:
    EquivalenceOracle<A,​I,​D>
    Direct Known Subclasses:
    DFARandomWpMethodEQOracle, MealyRandomWpMethodEQOracle, MooreRandomWpMethodEQOracle

    public class RandomWpMethodEQOracle<A extends UniversalDeterministicAutomaton<?,​I,​?,​?,​?> & Output<I,​D>,​I,​D>
    extends AbstractTestWordEQOracle<A,​I,​D>
    Implements an equivalence test by applying the Wp-method test on the given hypothesis automaton, as described in "Test Selection Based on Finite State Models" by S. Fujiwara et al. Instead of enumerating the test suite in order, this is a sampling implementation:
    • 1. sample uniformly from the states for a prefix
    • 2. sample geometrically a random word
    • 3. sample a word from the set of suffixes / state identifiers
    There are two parameters:minimalSize determines the minimal size of the random word, this is useful when one first performs a W(p)-method with some depth and continue with this randomized tester from that depth onward. The second parameter rndLength determines the expected length of the random word. (The expected length in effect is minimalSize + rndLength.) In the unbounded case it will not terminate for a correct hypothesis.
    • Constructor Detail

      • RandomWpMethodEQOracle

        public RandomWpMethodEQOracle​(MembershipOracle<I,​D> sulOracle,
                                      int minimalSize,
                                      int rndLength)
        Constructor for an unbounded testing oracle.
        Parameters:
        sulOracle - oracle which answers tests.
        minimalSize - minimal size of the random word
        rndLength - expected length (in addition to minimalSize) of random word
      • RandomWpMethodEQOracle

        public RandomWpMethodEQOracle​(MembershipOracle<I,​D> sulOracle,
                                      int minimalSize,
                                      int rndLength,
                                      int bound)
        Constructor for a bounded testing oracle.
        Parameters:
        sulOracle - oracle which answers tests.
        minimalSize - minimal size of the random word
        rndLength - expected length (in addition to minimalSize) of random word
        bound - specifies the bound (set to 0 for unbounded).
      • RandomWpMethodEQOracle

        public RandomWpMethodEQOracle​(MembershipOracle<I,​D> sulOracle,
                                      int minimalSize,
                                      int rndLength,
                                      int bound,
                                      int batchSize)
        Constructor for a bounded testing oracle with specific batch size.
        Parameters:
        sulOracle - oracle which answers tests.
        minimalSize - minimal size of the random word
        rndLength - expected length (in addition to minimalSize) of random word
        bound - specifies the bound (set to 0 for unbounded).
        batchSize - size of the batches sent to the membership oracle
      • RandomWpMethodEQOracle

        public RandomWpMethodEQOracle​(MembershipOracle<I,​D> sulOracle,
                                      int minimalSize,
                                      int rndLength,
                                      int bound,
                                      Random random,
                                      int batchSize)
        Constructor for a bounded testing oracle with specific batch size.
        Parameters:
        sulOracle - oracle which answers tests.
        minimalSize - minimal size of the random word
        rndLength - expected length (in addition to minimalSize) of random word
        bound - specifies the bound (set to 0 for unbounded).
        random - custom Random generator.
        batchSize - size of the batches sent to the membership oracle