Context: Bug-fix pattern detection has been investigated in the past in the context of classical software. However, while quantum software is developing rapidly, the literature still lacks automated methods and tools to identify, analyze, and detect bug-fix patterns. To the best of our knowledge, our work previously published in SEKE'23 was the first to leverage classical techniques to detect bug-fix patterns in quantum code. Objective: To extend our previous effort, we present a research agenda (Q-Repair), including a series of testing and debugging methodologies, to improve the quality of quantum software. The ultimate goal is to utilize machine learning techniques to automatically predict fix patterns for existing quantum bugs. Method: As part of the first stage of the agenda, we extend our initial study and propose a more comprehensive automated framework, called Q-PAC, for detecting bug-fix patterns in IBM Qiskit quantum code. In the framework, we develop seven bug-fix pattern detectors using abstract syntax trees, syntactic filters, and semantic checks. Results: To demonstrate our method, we run Q-PAC on a variety of quantum bug-fix patterns using both real-world and handcrafted examples of bugs and fixes. The experimental results show that Q-PAC can effectively identify bug-fix patterns in IBM Qiskit. Conclusion: We hope our initial study on quantum bug-fix detection can bring awareness of quantum software engineering to both researchers and practitioners. Thus, we also publish Q-PAC as an open-source software on GitHub. We would like to encourage other researchers to work on research directions (such as Q-Repair) to improve the quality of the quantum programming.
翻译:上下文:过去在经典软件领域已有针对Bug修复模式检测的研究。然而,随着量子软件的快速发展,学术界仍缺乏自动化的方法和工具来识别、分析和检测量子程序中的Bug修复模式。据我们所知,我们在SEKE'23上发表的先前工作是首次利用经典技术检测量子代码中Bug修复模式的研究。目标:为扩展前期工作,我们提出了一项研究议程(Q-Repair),涵盖一系列测试与调试方法论,旨在提升量子软件质量。最终目标是利用机器学习技术自动预测现有量子Bug的修复模式。方法:作为该议程的第一阶段,我们在初始研究基础上提出一个更全面的自动化框架Q-PAC,用于检测IBM Qiskit量子代码中的Bug修复模式。该框架中,我们基于抽象语法树、语法过滤器及语义检查开发了七种Bug修复模式检测器。结果:为验证方法有效性,我们使用实际案例与人工构造的Bug及其修复示例,在多种量子Bug修复模式上运行Q-PAC。实验结果表明,Q-PAC能够有效识别IBM Qiskit中的Bug修复模式。结论:我们期望针对量子Bug修复模式检测的初步研究能引起研究人员与从业者对量子软件工程的关注。为此,我们将Q-PAC作为开源软件发布在GitHub上,并鼓励其他研究者围绕Q-Repair等研究方向开展工作,以提升量子编程质量。