Class WMethodEQOracle<I,​O>

  • Type Parameters:
    I - input symbol type
    All Implemented Interfaces:
    EquivalenceOracle<net.automatalib.automaton.procedural.SPMM<?,​I,​?,​O>,​I,​net.automatalib.word.Word<O>>

    public class WMethodEQOracle<I,​O>
    extends AbstractTestWordEQOracle<net.automatalib.automaton.procedural.SPMM<?,​I,​?,​O>,​I,​net.automatalib.word.Word<O>>
    Implements an equivalence test by applying the W-method test on the procedures of the given hypothesis SBA, as described in "Testing software design modeled by finite state machines" by T.S. Chow.
    • Constructor Detail

      • WMethodEQOracle

        public WMethodEQOracle​(MembershipOracle<I,​net.automatalib.word.Word<O>> sulOracle,
                               int lookahead)
        Constructor. Convenience method for WMethodEQOracle(MembershipOracle, int, int) that sets expectedSize to 0.
        Parameters:
        sulOracle - interface to the system under learning
        lookahead - the maximum length of the "middle" part of the test cases
      • WMethodEQOracle

        public WMethodEQOracle​(MembershipOracle<I,​net.automatalib.word.Word<O>> sulOracle,
                               int lookahead,
                               int expectedSize)
        Constructor. Convenience method for WMethodEQOracle(MembershipOracle, int, int, int) that sets batchSize to 1.
        Parameters:
        sulOracle - interface to the system under learning
        lookahead - the (minimal) maximum length of the "middle" part of the test cases
        expectedSize - the expected size of the system under learning
      • WMethodEQOracle

        public WMethodEQOracle​(MembershipOracle<I,​net.automatalib.word.Word<O>> sulOracle,
                               int lookahead,
                               int expectedSize,
                               int batchSize)
        Constructor. Uses Math.max(lookahead, expectedSize - hypothesis.size()) to determine the maximum length of sequences, that should be appended to the transition-cover part of the test sequence to account for the fact that the system under learning may have more states than the current hypothesis.
        Parameters:
        sulOracle - interface to the system under learning
        lookahead - the (minimal) maximum length of the "middle" part of the test cases
        expectedSize - the expected size of the system under learning
        batchSize - size of the batches sent to the membership oracle
        See Also:
        WMethodTestsIterator
    • Method Detail

      • generateTestWords

        protected Stream<net.automatalib.word.Word<I>> generateTestWords​(net.automatalib.automaton.procedural.SPMM<?,​I,​?,​O> hypothesis,
                                                                         Collection<? extends I> inputs)
        Description copied from class: AbstractTestWordEQOracle
        Generate the stream of test words that should be used for the current equivalence check cycle.
        Specified by:
        generateTestWords in class AbstractTestWordEQOracle<net.automatalib.automaton.procedural.SPMM<?,​I,​?,​O>,​I,​net.automatalib.word.Word<O>>
        Parameters:
        hypothesis - the current hypothesis of the learning algorithm
        inputs - the collection of inputs to consider
        Returns:
        the stream of test words used for equivalence testing
        See Also:
        EquivalenceOracle.findCounterExample(Object, Collection)