Property-based testing has been previously proposed for quantum programs in Q# with QSharpCheck; however, this implementation was limited in functionality, lacked extensibility, and was evaluated on a narrow range of programs using a single property. To address these limitations, we propose QuCheck, an enhanced property-based testing framework in Qiskit. By leveraging Qiskit and the broader Python ecosystem, QuCheck facilitates property construction, introduces flexible input generators and assertions, and supports expressive preconditions. We assessed its effectiveness through mutation analysis on five quantum programs (2-10 qubits), varying the number of properties, inputs, and measurement shots to assess their impact on fault detection and demonstrate the effectiveness of property-based testing across a range of conditions. Results show a strong positive correlation between the mutation score (a measure of fault detection) and number of properties evaluated, with a moderate negative correlation between the false positive rate and number of measurement shots. Among the most thorough test configurations, those evaluating three properties achieved a mean mutation score ranging from 0.90 to 0.92 across all five algorithms, with the false positive rate between 0 and 0.04. QuCheck identified 36.0% more faults than QSharpCheck, with execution time reduced by 81.1%, despite one false positive. These findings underscore the viability of property-based testing for verifying quantum systems.
QSPE: Enumerating Skeletal Quantum Programs for Quantum Library Testing
Manufacturing Industry Chain Collaboration Industrial Software Key Laboratory of Sichuan Province(四川省制造业产业链协同工业软件重点实验室);Southwest Jiaotong University(西南交通大学);State Key Laboratory of Blockchain and Data Security(区块链与数据安全国家重点实验室);Zhejiang University(浙江大学);Kyushu University(九州大学);University of Luxembourg(卢森堡大学);Institute of AI for Industries(产业人工智能研究院)
QUT: A Unit Testing Framework for Quantum Subroutines
CSIRO’s Data61(CSIRO数据六十一);School of Computing and Information Systems, The University of Melbourne(墨尔本大学计算与信息学院);School of Science, RMIT University(皇家墨尔本理工大学理学院);University of New South Wales(新南威尔士大学);School of Physics, The University of Melbourne(墨尔本大学物理学院)
Automatic Test Pattern Generation for Robust Quantum Circuit Testing
Institute of Software, Chinese Academy of Sciences(中国科学院软件研究所);University of Chinese Academy of Sciences(中国科学院大学);Department of Computer and Information Science, University of Pennsylvania(宾夕法尼亚大学计算机与信息科学系);Centre for Quantum Software and Information, University of Technology Sydney(悉尼科技大学量子软件与信息研究中心)