Learning to Construct Better Mutation Faults

Zhao Tian, Junjie Chen, Qihao Zhu, Junjie Yang, Lingming Zhang

Research output: Chapter in Book/Report/Conference proceedingConference contribution


Mutation faults are the core of mutation testing and have been widely used in many other software testing and debugging tasks. Hence, constructing high-quality mutation faults is critical. There are many traditional mutation techniques that construct syntactic mutation faults based on a limited set of manually-defined mutation operators. To improve them, the state-of-the-art deep-learning (DL) based technique (i.e., DeepMutation) has been proposed to construct mutation faults by learning from real faults via classic sequence-to-sequence neural machine translation (NMT). However, its performance is not satisfactory since it cannot ensure syntactic correctness of constructed mutation faults and suffers from the effectiveness issue due to the huge search space and limited features by simply treating each targeted method as a token stream. In this work, we propose a novel DL-based mutation technique (i.e., LEAM) to overcome the limitations of both traditional techniques and DeepMutation. LEAM adapts the syntax-guided encoder-decoder architecture by extending a set of grammar rules specific to our mutation task, to guarantee syntactic correctness of constructed mutation faults. Instead of predicting a sequence of tokens one by one to form a whole mutated method, it predicts the statements to be mutated under the context of the targeted method to reduce search space, and then predicts grammar rules for mutation fault construction based on both semantic and structural features in AST. We conducted an extensive study to evaluate LEAM based on the widely-used Defects4J benchmark. The results demonstrate that the mutation faults constructed by LEAM can not only better represent real faults than two state-of-the-art traditional techniques (i.e., Major and PIT) and DeepMutation, but also substantially boost two important downstream applications of mutation faults, i.e., test case prioritization and fault localization.

Original languageEnglish (US)
Title of host publication37th IEEE/ACM International Conference on Automated Software Engineering, ASE 2022
EditorsMario Aehnelt, Thomas Kirste
PublisherAssociation for Computing Machinery
ISBN (Electronic)9781450396240
StatePublished - Sep 19 2022
Event37th IEEE/ACM International Conference on Automated Software Engineering, ASE 2022 - Rochester, United States
Duration: Oct 10 2022Oct 14 2022

Publication series

NameACM International Conference Proceeding Series


Conference37th IEEE/ACM International Conference on Automated Software Engineering, ASE 2022
Country/TerritoryUnited States


  • Deep Learning
  • Fault Injection
  • Mutation Testing

ASJC Scopus subject areas

  • Software
  • Human-Computer Interaction
  • Computer Vision and Pattern Recognition
  • Computer Networks and Communications


Dive into the research topics of 'Learning to Construct Better Mutation Faults'. Together they form a unique fingerprint.

Cite this