This paper presents the first concolic testing framework specifically designed for quantum programs. The framework defines quantum conditional statements that quantify quantum states and presents a symbolization method for quantum variables. Utilizing this framework, we generate path constraints for each concrete execution path of a quantum program. These constraints guide the exploration of new paths, with a quantum constraint solver determining the outcomes to generate novel input samples and enhance branch coverage. We implemented this framework in Python and integrated it with Qiskit for practical evaluation. Experimental results demonstrate that our concolic testing framework significantly improves branch coverage and the quality of quantum input samples, demonstrating its effectiveness and efficiency in quantum software testing.
翻译:本文提出了首个专门针对量子程序的Concolic测试框架。该框架定义了量化量子态的量子条件语句,并提出了一种量子变量的符号化方法。利用该框架,我们为量子程序的每条具体执行路径生成路径约束。这些约束引导新路径的探索,其中量子约束求解器通过判定结果来生成新颖的输入样本,进而提升分支覆盖率。我们使用Python实现了该框架,并将其与Qiskit集成以进行实际评估。实验结果表明,我们的Concolic测试框架显著提高了分支覆盖率和量子输入样本的质量,验证了其在量子软件测试中的有效性和高效性。