Assessing the Effectiveness of Input and Output Coverage Criteria for Testing Quantum Programs

Quantum programs implement quantum algorithms solving complex computational problems. Testing such programs is challenging due to the inherent characteristics of Quantum Computing (QC), such as the probabilistic nature and computations in superposition. However, automated and systematic testing is needed to ensure the correct behavior of quantum programs. To this end, we present an approach called Quito (QUantum InpuT Output coverage) consisting of three coverage criteria defined on the inputs and outputs of a quantum program, together with their test generation strategies. Moreover, we define two types of test oracles, together with a procedure to determine the passing and failing of test suites with statistical analyses. To evaluate the cost-effectiveness of the three coverage criteria, we conducted experiments with five quantum programs. We used mutation analysis to determine the coverage criteria’ effectiveness and cost in terms of the number of test cases. Based on the results of mutation analysis, we also identified equivalent mutants for quantum programs.

[1]  Paul Adrien Maurice Dirac,et al.  A new notation for quantum mechanics , 1939, Mathematical Proceedings of the Cambridge Philosophical Society.

[2]  Magnus C. Ohlsson,et al.  Experimentation in Software Engineering , 2000, The Kluwer International Series in Software Engineering.

[3]  D. Nolte A Primer on Quantum Computing , 2006 .

[4]  Xiaodi Wu,et al.  Invariants of quantum programs: characterisations and generation , 2017, POPL.

[5]  Yue Gao,et al.  QuanFuzz: Fuzz Testing of Quantum Program , 2018, ArXiv.

[6]  Margaret Martonosi,et al.  QDB: From Quantum Algorithms Towards Correct Quantum Programs , 2018, PLATEAU@SPLASH.

[7]  Sunita Garhwal,et al.  Quantum Programming Language: A Systematic Review of Research Topic and Top Cited Languages , 2019, Archives of Computational Methods in Engineering.

[8]  Li Zhou,et al.  An applied quantum Hoare logic , 2019, PLDI.

[9]  Andriy V. Miranskyy,et al.  On Testing Quantum Programs , 2018, 2019 IEEE/ACM 41st International Conference on Software Engineering: New Ideas and Emerging Results (ICSE-NIER).

[10]  Yves Le Traon,et al.  Chapter Six - Mutation Testing Advances: An Analysis and Survey , 2019, Adv. Comput..

[11]  Rajagopal Nagarajan,et al.  Property-based Testing of Quantum Programs in Q# , 2020, ICSE.

[12]  Jianjun Zhao,et al.  Quantum Software Engineering: Landscapes and Horizons , 2020, ArXiv.