Generating a test suite for a quantum program such that it has the maximum number of failing tests is an optimization problem. For such optimization, search-based testing has shown promising results in the context of classical programs. To this end, we present a test generation tool for quantum programs based on a genetic algorithm, called QuSBT (Search-based Testing of Quantum Programs). QuSBT automates the testing of quantum programs, with the aim of finding a test suite having the maximum number of failing test cases. QuSBT utilizes IBM's Qiskit as the simulation framework for quantum programs. We present the tool architecture in addition to the implemented methodology (i.e., the encoding of the search individual, the definition of the fitness function expressing the search problem, and the test assessment w.r.t. two types of failures). Finally, we report results of the experiments in which we tested a set of faulty quantum programs with QuSBT to assess its effectiveness. Repository (code and experimental results): https://github.com/Simula-COMPLEX/qusbt-tool Video: https://youtu.be/3apRCtluAn4
翻译:为量子程序生成一个测试套件,使其最大数量测试失败是一个优化问题。 对于这种优化,基于搜索的测试在古典程序背景下显示了有希望的结果。 为此,我们为量子程序提供了一个基于基因算法的测试生成工具,称为 QuSBT (基于搜索的量子程序测试)。 QuSBT 自动将量子程序测试结果化, 目的是找到一个测试套件, 其测试案例数量最大。 QuSBT 使用 IBM 的 Qiskit 作为量子程序的模拟框架。 我们除了采用的方法( 即搜索个人的编码、 表达搜索问题的健身功能的定义 以及测试评估 w.r. t. 两种失败) 外, 还介绍了工具结构。 最后, 我们用 QuSBT 测试了一组错误的量子程序以评估其有效性的实验结果。 重新positoryal( 代码和实验结果): https://github.com/Simula-COMPL4/EX/qubtustool.