Efficient Active Automata Learning via Mutation Testing

Bernhard K. Aichernig, Martin TapplerJ. Autom. Reason 2019

Introduction: The Bottleneck of Active Learning

Active automata learning, exemplified by the $L^*$ algorithm, is a powerful technique for inferring formal models of "black-box" systems through interaction. By treating a system as a Mealy machine, researchers can verify legacy software, analyze communication protocols like TCP or TLS, and identify security vulnerabilities without access to source code.

The learning process relies on a "Minimally Adequate Teacher" (MAT) framework. The learner poses two types of queries: Membership Queries (asking for the output of a specific input sequence) and Equivalence Queries (asking if a current hypothesis model is correct). While membership queries are straightforward, equivalence queries are the primary bottleneck. In practice, they are approximated using conformance testing, which involves executing extensive test suites to find counterexamples. These suites often grow exponentially, making the learning of complex real-world systems computationally prohibitive.

The interaction between the Learning Algorithm and the Teacher (SUL and Testing Tool).

Methodology: Mutation-Guided Conformance Testing

This paper introduces a novel approach to equivalence queries by replacing exhaustive testing with a randomized strategy guided by model-based mutation testing. The core idea is to shift the focus from "proving equivalence" to "finding counterexamples efficiently."

The "Split-State" Mutation Operator

The authors' key innovation is the "split-state" mutation operator. Unlike standard mutations that simply alter an output, this operator simulates the specific structural errors common in active learning—such as the incorrect merging of two distinct system states into one. By injecting these "split-state" faults into the hypothesis model, the system generates "mutants" that represent likely discrepancies between the hypothesis and the actual System Under Learning (SUL).

Efficient Test Selection

The framework generates a large pool of random test sequences but only executes a small, high-value subset on the SUL. Tests are selected based on their ability to "kill" (distinguish) the generated mutants from the current hypothesis. To manage the overhead of simulating thousands of mutants, the authors utilize a Non-deterministic Finite Automaton (NFA) to represent all mutants simultaneously, allowing for rapid, single-pass test evaluation.

An example of a Mealy machine representing a system state machine.

Results and Impact

The proposed method was evaluated against 16 real-world protocol implementations, including TCP, MQTT, and TLS servers. The results demonstrate a significant reduction in the cost of learning:

  • TCP Servers: The mutation-based approach achieved an average speedup of 51.5x in terms of test steps compared to the standard partial W-method.
  • MQTT Case Study: For the VerneMQ broker, the learning time was slashed from an estimated 63.9 hours to just 3.1 hours.
  • Deep Counterexamples: The method proved more effective than other randomized techniques at finding the "deep" counterexamples necessary to finalize complex models, particularly for TLS implementations.

Conclusion

By leveraging mutation testing to guide the search for counterexamples, the authors have significantly mitigated the equivalence query bottleneck. This advancement makes formal model inference feasible for a wider range of complex, black-box systems. Future work aims to extend this efficiency to even larger state spaces and more expressive models like Extended Finite State Machines (EFSMs).

Summary updated

BibTeX
@article{aichernig2019efficient,
  author = {Bernhard K. Aichernig and Martin Tappler},
  title = {{Efficient Active Automata Learning via Mutation Testing}},
  journal = {J. Autom. Reason.},
  year = {2019},
  doi = {10.1007/s10817-018-9486-0},
}
Figure