arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2208.09206cs.SE
收藏

用多个子程序测试量子程序

Testing Quantum Programs with Multiple Subroutines

Peixun Long, Jianjun Zhao

摘要:

由于量子程序的不确定性,量子程序中的错误很难追踪。因此,测试是保证量子软件质量的一种不可或缺的方法。现有的量子程序测试方法只针对量子电路或单个子程序,无法有效地测试多个子程序。在本文中,我们首先讨论了测试多子程序量子程序时必须考虑的几个关键问题,并指出现有测试方法的局限性和问题。然后,我们提出了一个新的框架,用于测试多子程序的量子程序,允许单元和集成测试。我们的框架包括两个新的测试覆盖率标准的量子变量的等价类划分,以指导我们的测试任务和技术来测试量子程序与几个常见的模式。我们还讨论了如何生成测试用例的基础上,我们的框架。为了评估我们的测试框架的有效性,我们实现了一个名为QSharpTester的工具,用于测试具有多个子例程的Q\#程序。我们用它来进行实验,从七个原始Q程序派生的数百个变异程序。实验结果表明,我们的测试方法可以处理更广泛的类型的量子程序比现有的,几乎所有的错误变异程序表现良好。

英文摘要:

Errors in quantum programs are challenging to track down due to the uncertainty of quantum programs. Testing is, therefore, an indispensable method for assuring the quality of quantum software. Existing testing methods focus only on testing quantum programs with quantum circuits or single subroutines and, therefore, cannot effectively test quantum programs with multi-subroutines. In this paper, we first discuss several critical issues that must be considered when testing multi-subroutine quantum programs and point out the limitations and problems with existing testing methods. We then present a novel framework for testing multi-subroutine quantum programs that allow for both unit and integration testing. Our framework includes two novel test coverage criteria for the equivalent class partition of quantum variables to guide our testing tasks and techniques to test quantum programs with several common patterns. We also discuss how to generate test cases based on our framework. To evaluate the effectiveness of our testing framework, we implemented a tool called QSharpTester for testing Q\# programs with multiple subroutines. We used it to conduct experiments on hundreds of mutation programs deriving from seven original Q\# programs. The experimental results show that our testing methods can deal with broader types of quantum programs than existing ones and perform well on almost all faulty mutation programs.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑