Quantum computing has emerged as a promising field with the potential to revolutionize various domains by harnessing the principles of quantum mechanics. As quantum hardware and algorithms continue to advance, the development of high-quality quantum software has become crucial. However, testing quantum programs poses unique challenges due to the distinctive characteristics of quantum systems and the complexity of multi-subroutine programs. In this paper, we address the specific testing requirements of multi-subroutine quantum programs. We begin by investigating critical properties through a survey of existing quantum libraries, providing insights into the challenges associated with testing these programs. Building upon this understanding, we present a systematic testing process tailored to the intricacies of quantum programming. The process covers unit testing and integration testing, with a focus on aspects such as IO analysis, quantum relation checking, structural testing, behavior testing, and test case generation. We also introduce novel testing principles and criteria to guide the testing process. To evaluate our proposed approach, we conduct comprehensive testing on typical quantum subroutines, including diverse mutations and randomized inputs. The analysis of failures provides valuable insights into the effectiveness of our testing methodology. Additionally, we present case studies on representative multi-subroutine quantum programs, demonstrating the practical application and effectiveness of our proposed testing processes, principles, and criteria.
翻译:量子计算作为一个有前景的领域已经兴起,通过利用量子力学原理,有望彻底改变多个领域。随着量子硬件和算法的持续进步,高质量量子软件的开发变得至关重要。然而,由于量子系统的独特特性以及多子程序程序的复杂性,测试量子程序面临独特挑战。在本文中,我们针对多子程序量子程序的具体测试需求展开研究。我们首先通过对现有量子库的调查来研究关键属性,为测试这些程序所面临的挑战提供见解。基于此理解,我们提出了一套针对量子编程复杂性的系统化测试流程。该流程涵盖单元测试和集成测试,重点关注IO分析、量子关系检查、结构测试、行为测试和测试用例生成等方面。我们还引入了新颖的测试原则和标准来指导测试过程。为评估所提出的方法,我们对典型量子子程序进行了全面测试,包括多种变异和随机输入。失败分析为评估测试方法的有效性提供了宝贵见解。此外,我们给出了代表性多子程序量子程序的案例研究,展示了所提出的测试流程、原则和标准的实际应用与有效性。