Software under test can be analyzed dynamically, while it is being executed, to find defects. However, as the number and possible values of input parameters increase, the cost of dynamic testing rises. This paper examines whether quantum computers (QCs) can help speed up the dynamic testing of programs written for classical computers (CCs). To accomplish this, an approach is devised involving the following three steps: (1) converting a classical program to a quantum program; (2) computing the number of inputs causing errors, denoted by $K$, using a quantum counting algorithm; and (3) obtaining the actual values of these inputs using Grover's search algorithm. This approach can accelerate exhaustive and non-exhaustive dynamic testing techniques. On the CC, the computational complexity of these techniques is $O(N)$, where $N$ represents the count of combinations of input parameter values passed to the software under test. In contrast, on the QC, the complexity is $O(\varepsilon^{-1} \sqrt{N/K})$, where $\varepsilon$ is a relative error of measuring $K$. The paper illustrates how the approach can be applied and discusses its limitations. Moreover, it provides a toy example executed on a simulator and an actual QC. This paper may be of interest to academics and practitioners as the approach presented in the paper may serve as a starting point for exploring the use of QC for dynamic testing of CC code.
翻译:在测试中,可以对软件进行动态分析以找出缺陷。然而,随着投入参数的数量和可能值的增加,动态测试的成本会上升。本文审视量子计算机(QCs)能否帮助加速古典计算机(CCs)程序动态测试。为此,设计了一个方法,涉及以下三个步骤:(1) 将古典程序转换成量子程序;(2) 使用量数计算算算算法计算造成错误的投入数量,用K美元表示;(3) 使用 Grover的搜索算法获取这些投入的实际值。这种方法可以加速详尽和非详尽的动态测试技术。在CC上,这些技术的计算复杂性是$O(N),其中$N是用于测试中软件输入的输入参数值的组合数。相比之下,在QC上,使用量子计算法的复杂性是$(carepsqrt{N/K} 美元);(3) 使用Grqrt{K},其中, 美元是衡量美元开始量值的相对错误。在Q上,文件的计算方法的计算复杂度,可以用来解释其实际使用量度,作为文件的试算。