Skip to main content
Log in

Formalization of Structural Test Cases Coverage Criteria for Quantum Software Testing

  • Published:
International Journal of Theoretical Physics Aims and scope Submit manuscript

Abstract

Quantum computing is a rapidly growing area that solves certain problems with exponential speed up. Quantum software is more error-prone than conventional software due to the principle of quantum mechanics and the cryogenic environment of a quantum computer. Cyclomatic complexity play a significant role in the generation of test cases. In this paper, we will introduce the Cyclomatic complexity concept to represent the logical complexity of a quantum program. Cyclomatic complexity represents the number of independent paths and paths generated due to the superposition of each control qubit. Furthermore, coverage criteria based on structural testing have been proposed for testing a quantum program.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5

Similar content being viewed by others

Data Availability

Data sharing not applicable to this article as no datasets were generated or analysed during the current study.

References

  1. Zhao, J.: Quantum Software Engineering: landscapes and horizons, pp. 1–34. arXiv:https://doi.org/2007.07047. https://doi.org/10.48550 (2021)

  2. Zhao, P., Zhao, J., Ma, L.: Identifying bug patterns in quantum programs. In: IEEE/ACM 2nd International Workshop on Quantum Software Engineering (Q-SE), Madrid, Spain, Virtual, 1-2 June vol. 2, pp. 16–21 (2021)

  3. Honarvar, S., Mousavi, M.R., Nagarajan, R.: Property-based testing of quantum programs in Q#. In: IEEE/ACM 42nd, International Conference on Software Engineering Workshops (ICSEW), Seoul Republic of Korea, 27 June 19 July, vol. 42, pp. 430–435 (2020)

  4. Usaola, M.P.: Quantum software testing 1, pp. 1–6. https://ruidera.uclm.es/xmlui/handle/10578/28913 (2020)

  5. Qiskit textbook(beta). https://qiskit.org/textbook-beta/. Accessed on 15 Nov 2022 (2022)

  6. Garhwal, S., Ghorani, M., Ahmad, A.: Quantum programming language: a systematic review of research topic and top cited languages. Archives Computat. Methods Eng. 28, 289–310 (2021)

    Article  MathSciNet  Google Scholar 

  7. Kumar, A., Garhwal, S.: State-of-the-art survey of quantum cryptography. Archives Computat. Methods Eng. 28, 3831–3868 (2021)

    Article  MathSciNet  Google Scholar 

  8. Kadian, K., Garhwal, S., Kumar, A.: Quantum walk and its application domains: a systematic review. Comput. Sci. Rev. 41(100419), 1–52 (2021)

    MathSciNet  MATH  Google Scholar 

  9. Barrera, A.G.D.L., Guzman, I.G.D., Polo, M., Piattini, M.: Quantum software testing : state of the art. J. Softw. Evolution Process, pp. 1–14. https://doi.org/10.1002/smr.2419 (2021)

  10. Liu, J., Zhan, B., Wang, S., Ying, S., Liu, T., Li, Y., Ying, M., Zhan, N.: Formal verification of quantum algorithms using quantum hoare logic. Int. Conf. Comput. Aided Verif., CAV 2019 New York, NY, USA, 15-18 Jul. Lecture Notes Comput. Sci., LNTCS 11562, 187–207 (2019)

    MathSciNet  Google Scholar 

  11. Zhou, L., Yu, N., Ying, M.: An applied quantum hoare logic, PLDI. Proc. 40th, ACM SIGPLAN Conf. Program. Lang. Design Implementation, Phoenix, AZ, USA, 22-26 Jun 40(2019), 1149–1162 (2019)

    Article  Google Scholar 

  12. Paltenghi, M., Pradel, M.: Morphq: Metamorphic Testing of Quantum Computing Platforms, pp. 1–12. arXiv:2206.01111. (2022)

  13. Metwalli, S.A., Meter, R.V.: A Tool for Debugging Quantum Circuits, pp. 1–11. arXiv:2205.01899. https://doi.org/10.48550/ (2022)

  14. Miranskyy, A., Zhang, L., Doliskani, J.: Is your quantum program bug-free?. In: ICSE-NIER’20: Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering: New Ideas and Emerging Results, Seoul South Korea, 27- June 19 July, pp. 29–32. https://doi.org/10.1145/3377816.3381731 (2020)

  15. Wang, X., Arcaini, P., Yue, T., Ali, S.: Application of combinatorial testing to quantum programs. In: IEEE 21st International Conference on Software Quality, Reliability and Security (QRS), Hainan, China, 6-10 Dec, pp. 179–188. https://doi.org/10.1109/QRS54544.2021.00029 (2021)

  16. Ali, S., Arcaini, P., Wang, X., Yue, T.: Assessing the effectiveness of input and output coverage criteria for testing quantum programs. In: 14th, IEEE International Conference on Software Testing, Verification, and Validation (ICST), Porto de Galinhas, Brazil, 12-16 Apr, pp. 13–23. https://doi.org/10.1109/ICST49551.2021.00014(2021)

  17. Zhao, J.: Some size and structure metrics for quantum software. In: 2nd International Workshop on Quantum Software Engineering (Q-SE 2021), Madrid, Spain, virtual, 1-2 June, pp. 22–27 (2021)

  18. Cruz-Lemus, J.A., Marcelo, L.A., Piattini, M.: Towards a set of metrics for quantum circuits understandability. In: International Conference on the Quality of Information and Communications Technology, Quality of Information and Communications Technology (QUATIC 2021), Algarve, Portugal, 8-11 Sept, pp. 243–249 (2021)

  19. Azad, U., Papneja, A., Saini, R., Behra, B.K., Panigrahi, P.K.: Circuit centric quantum architecture design. IET Quantum Commun. 2, 14–25 (2021)

    Article  Google Scholar 

  20. Maslov, D., Miller, D.M.: Comparison of the cost metrics through investigation of the relation between optimal NCV and optimal NCT three-qubit reversible circuits. IET Comput. Digital Technqiues 1(2), 98–104 (2007)

    Article  Google Scholar 

  21. Wang, X., Yu, T., Arcaini, P., Yue, T., Ali, S.: Mutation-based Test Generation for Quantum Programs with Multi-objective Search. In: GECCO’22: Proceedings of the Genetic and Evolutionary Computation Conference, Boston Massachusetts, 9-13 Jul, pp. 1345–1353. https://doi.org/10.1145/3512290.3528869(2022)

  22. Singla, T., Kumar, A., Garhwal, S.: Reducing mutation testing endeavor using the similar conditions for the same mutation operators occurs at different locations. Appl. Math. Inf. Sci. 8(5), 2389–2393 (2014)

    Article  Google Scholar 

  23. Fortunato, D., Campos, J., Abreu, R.: QMutPy: a mutation testing tool for quantum algorithms and applications in Qiskit. In: ISSTA 2022: Proceedings of the 31st, ACM SIGSOFT International Symposium on Software Testing and Analysis, pp. 797–800. https://doi.org/10.1145/3533767.3543296 (2022)

  24. Luo, J., Zhao, P., Miao, Z., Lan, S., Zhao, J.: A comprehensive study of bug fixes in quantum programs. arXiv:2201.08662, pp. 1–8 (2022)

  25. Huang, Y., Martonosi, M.: QDB: from quantum algorithms towards correct quantum programs. In: 9th Workshop on Evaluation and Usability of Programming Languages and Tools (PLATEAU 2018), OpenAccess Series in Informatics (OASIcs). 10.4230/OASIcs.PLATEAU.2018.4, pp. 4:1–4:14 (2019)

  26. Campos, J., Souto, A.: QBugs: a collection of reproducible bugs in quantum algorithms and a supporting infrastructure to enable controlled quantum software testing and debugging experiments. In: IEEE/ACM 2nd, International Workshop on Quantum Software Engineering (Q-SE), pp. 28–32. arXiv:2103.16968. https://doi.org/10.48550/ (2021)

  27. Wang, J., Gao, M., Jiang, Y., Lou, J., Gao, Y., Zhang, D., Sun, J.: Quanfuzz: fuzz testing of quantum program, pp 1–5. arXiv:1810.10310. https://doi.org/10.48550/ (2018)

  28. Kumar, A., Kwatra, P., Garhwal, S.: Development of a tool for finding equivalent mutants in quantum program: a perspective to measure the quality of quantum software, Preprint available at ResearchSquare. https://doi.org/10.21203/rs.3.rs-2250025/v1, pp. 1–17 (2022)

  29. McCabe, T.J.: A complexity measure. IEEE Trans. Softw. Eng. 2 (4), 308–320 (1976)

    Article  MathSciNet  MATH  Google Scholar 

  30. Mills, H.D.: Mathematical foundations for structured programming. Federal System Division, IBM Corp, Gaithersburg MD, FSC 72-6012 (1972)

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Ajay Kumar.

Ethics declarations

Conflict of Interests

The author declare no competing financial interest.

Additional information

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Kumar, A. Formalization of Structural Test Cases Coverage Criteria for Quantum Software Testing. Int J Theor Phys 62, 49 (2023). https://doi.org/10.1007/s10773-022-05271-y

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s10773-022-05271-y

Keywords

Navigation