Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Log inSign up
Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Blog
Job Board
Q3AS

© 2026 Aqora Quantum S.A.S.

TermsPrivacyLegal Notice

arXiv:2306.17407 · ACM Transactions on Software Engineering and Methodology

Testing Multi-Subroutine Quantum Programs: From Unit Testing to Integration Testing

Peixun Long, Jianjun Zhao

Published Apr 5, 2024• 28 citations
arXivHTMLPDF

Abstract

Quantum computing has emerged as a promising field with the potential to revolutionize various domains by harnessing the principles of quantum mechanics. As quantum hardware and algorithms continue to advance, developing high-quality quantum software has become crucial. However, testing quantum programs poses unique challenges due to the distinctive characteristics of quantum systems and the complexity of multi-subroutine programs. This article addresses the specific testing requirements of multi-subroutine quantum programs. We begin by investigating critical properties by surveying existing quantum libraries and providing insights into the challenges of testing these programs. Building upon this understanding, we focus on testing criteria and techniques based on the whole testing process perspective, spanning from unit testing to integration testing. We delve into various aspects, including IO analysis, quantum relation checking, structural testing, behavior testing, integration of subroutine pairs, and test case generation. We also introduce novel testing principles and criteria to guide the testing process. We conduct comprehensive testing on typical quantum subroutines, including diverse mutants and randomized inputs, to evaluate our proposed approach. The analysis of failures provides valuable insights into the effectiveness of our testing methodology. Additionally, we present case studies on representative multi-subroutine quantum programs, demonstrating the practical application and effectiveness of our proposed testing principles and criteria.

DOI
10.1145/3656339

Related papers

Testing Quantum Programs with Multiple Subroutines

Peixun Long, Jianjun Zhao

Errors in quantum programs are challenging to track down due to the uncertainty of quantum programs. Testing is, therefore, an indispensable method for assuring the quality of quantum software. Existing testing methods focus only on testing quantum programs with quantum circuits or single subroutines and, therefore, cannot effectively test quantum programs with multi-subroutines. In this paper, we first discuss several critical issues that must be considered when testing multi-subroutine quantum programs and point out the limitations and problems with existing testing methods. We then present a novel framework for testing multi-subroutine quantum programs that allow for both unit and integration testing. Our framework includes two novel test coverage criteria for the equivalent class partition of quantum variables to guide our testing tasks and techniques to test quantum programs with several common patterns. We also discuss how to generate test cases based on our framework. To evaluate the effectiveness of our testing framework, we implemented a tool called QSharpTester for testing Q\# programs with multiple subroutines. We used it to conduct experiments on hundreds of mutation programs deriving from seven original Q\# programs. The experimental results show that our testing methods can deal with broader types of quantum programs than existing ones and perform well on almost all faulty mutation programs.

arXiv:2208.09206•Aug 19, 2022•4 citations

Context-aware unit testing for quantum subroutines

Mykhailo V. Klymenko, Thong Hoang, Samuel A Wilkinson +6 more

Abstract Software testing is a critical component of the classical software development lifecycle, and this principle is expected to hold true for quantum software as it evolves toward large-scale production and adherence to industry standards. Developing and testing quantum software presents unique challenges due to the non-deterministic nature of quantum information, the high dimensionality of the underlying Hilbert space, complex hardware noise, and the inherent non-local properties of quantum systems. In this work, we propose a unifying theoretical framework based on probabilistic assertions, which encompasses several testing approaches—such as quantum tomography and statistical tests—for developing practical unit tests for quantum subroutines. The framework is built upon the semantic equivalence between quantum subroutines and parameterized quantum channels, as established in this work. To address the computational complexity associated with unit testing in quantum systems, we propose incorporating context-awareness into the testing process. The trade-offs between accuracy, state space coverage, and efficiency associated with the proposed theoretical framework for quantum unit testing have been demonstrated through its application to a simple three-qubit quantum subroutine that prepares a Greenberger–Horne–Zeilinger state, as well as to subroutines within a program implementing Shor’s algorithm.

arXiv:2506.10348•Quantum Science and Technology•Apr 21, 2026•0 citations

A Survey of Functional Testing and Validation of Quantum Circuits

Emma Andrews, Aruna Jayasena, Prabhat Mishra

Quantum computing has the potential to solve a wide variety of classically intractable problems. However, the inherent complexity, probabilistic behavior, and fragility of quantum systems pose significant challenges to ensuring the correctness and reliability of quantum programs. In this survey, we present a comprehensive overview of functional testing and validation techniques aimed at addressing these challenges for quantum circuits. We begin by outlining the unique characteristics of quantum systems that complicate traditional testing methodologies, including the absence of classical oracles, non-determinism due to quantum measurement, and the exponential growth of the state space. We then categorize and analyze a wide range of functional testing and validation techniques that have emerged to meet these challenges, including mutation testing, fuzz testing, and coverage testing. We further explore advanced semantic and white-box methods such as property-based testing, metamorphic testing, equivalence checking, fault testing, assertions, and concolic testing. Specifically, we discuss the applicability of these testing techniques to quantum circuits and examine their limitations in the current NISQ (Noisy Intermediate-Scale Quantum) era.

IEEE Design and Test•May 29, 2026•0 citations

QUT: A Unit Testing Framework for Quantum Subroutines

Mykhailo V. Klymenko, Thong Hoang, Hoa T. Nguyen +6 more

We present the architectural design and prototype implementation of QUT (Quantum Unit Testing), a framework for unit testing of quantum subroutines. The framework is developed with a focus on usability and simplicity, making the complex theoretical concepts behind quantum unit testing accessible to a wide range of users with diverse backgrounds. This is achieved through the implementation of polymorphic probabilistic assertions, whose evaluation methods adapt to the data types of the arguments used in assertion statements, which may vary according to the context-dependent semantics of quantum subroutines. These arguments can be represented as qubit measurement outcomes, density matrices, or Choi matrices. For each type, the architecture integrates a specific testing protocol - such as quantum process tomography, quantum state tomography, or Pearson's chi-squared test - while remaining flexible enough to incorporate additional protocols in the future. The framework is built on the Qiskit software stack, providing compatibility with a broad range of quantum hardware backends and simulation platforms. Drawing on the reasoning provided by the denotational semantics of quantum subroutines, this work also highlights the key distinctions between quantum unit testing and its classical counterpart.

arXiv:2509.17538•Sep 22, 2025•0 citations

A Survey on Fuzz Testing for Quantum Computing

Fernando Betanzo Sanchez

As quantum computing transitions from theoretical concepts to commercially available quantum processing units, ensuring the quality, reliability, and correctness of quantum software systems has become paramount. The unique challenges of quantum software testing have necessitated the adaptation of classical software engineering techniques to the quantum domain. One such technique is fuzz testing, or fuzzing, an automated software testing technique that generates large volumes of inputs to identify bugs and unexpected behaviors. In this work we provide a comprehensive examination of how fuzz testing has been successfully applied to quantum computing. We analyze the application of fuzzing across the quantum ecosystem, from testing quantum programs to verifying quantum software stacks, quantum compilers, and quantum simulators. This survey establishes the foundation for understanding how fuzz testing can ensure the reliability and correctness of quantum software systems and outlines promising future research directions.

IEEE CHILEAN Conference on Electrical, Electronics Engineering, Information and Communication Technologies (CHILECON)•Oct 28, 2025•0 citations

12 Methods and tools to improve quantum software quality: a survey

Mahsa Radnejad, Khushdeep Kaur, Houbing Herbert Song +1 more

With recent breakthroughs in quantum computing, it has become a coming reality instead of a promising future. Quantum computing applications offer revolutionary potential across multiple domains including artificial intelligence (AI), optimization, healthcare, energy, and space, known as quantum advantage. The power of quantum computing relies on novel quantum algorithms, quantum software, and hardware. Unlike classical software, quantum software has unique features because of quantum mechanics such as superposition and noncloning. This opens a new research field - quantum software engineering (QSE). While the software engineering (SE) research community became aware of this need in 2019, we noticed the lack of a comprehensive investigation of state-of-the-art technologies and tools to improve quantum software quality. Testing and debugging are the two most efficient approaches to assure software quality in classical SE. In QSE, testing and debugging quantum programs become challenging due to quantum mechanics. While we can leverage some best practices from the classical world, new techniques and tools are needed to address the concerns in QSE. In this chapter, we first conduct a survey study of the state-of-the-art technologies and tools for testing and debugging quantum software. This study includes but is not limited to quantum bug pattern analysis and detection, quantum software testing techniques and classification, and quantum debugging techniques. In the second place, we provide our visions and insights of testing and debugging quantum software in terms of challenges and opportunities for improving quantum software quality. This survey has the potential to foster a research community committed to developing novel methods and tools for QSE.

De Gruyter eBooks•Jul 22, 2024•2 citations
Quantum computing has emerged as a promising field with the potential to revolutionize various domains by harnessing the principles of quantum mechanics. As quantum hardware and algorithms continue to advance, developing high-quality quantum software has become crucial. However, testing quantum programs poses unique challenges due to the distinctive characteristics of quantum systems and the complexity of multi-subroutine programs. This article addresses the specific testing requirements of multi-subroutine quantum programs. We begin by investigating critical properties by surveying existing quantum libraries and providing insights into the challenges of testing these programs. Building upon this understanding, we focus on testing criteria and techniques based on the whole testing process perspective, spanning from unit testing to integration testing. We delve into various aspects, including IO analysis, quantum relation checking, structural testing, behavior testing, integration of subroutine pairs, and test case generation. We also introduce novel testing principles and criteria to guide the testing process. We conduct comprehensive testing on typical quantum subroutines, including diverse mutants and randomized inputs, to evaluate our proposed approach. The analysis of failures provides valuable insights into the effectiveness of our testing methodology. Additionally, we present case studies on representative multi-subroutine quantum programs, demonstrating the practical application and effectiveness of our proposed testing principles and criteria.
Errors in quantum programs are challenging to track down due to the uncertainty of quantum programs. Testing is, therefore, an indispensable method for assuring the quality of quantum software. Existing testing methods focus only on testing quantum programs with quantum circuits or single subroutines and, therefore, cannot effectively test quantum programs with multi-subroutines. In this paper, we first discuss several critical issues that must be considered when testing multi-subroutine quantum programs and point out the limitations and problems with existing testing methods. We then present a novel framework for testing multi-subroutine quantum programs that allow for both unit and integration testing. Our framework includes two novel test coverage criteria for the equivalent class partition of quantum variables to guide our testing tasks and techniques to test quantum programs with several common patterns. We also discuss how to generate test cases based on our framework. To evaluate the effectiveness of our testing framework, we implemented a tool called QSharpTester for testing Q\# programs with multiple subroutines. We used it to conduct experiments on hundreds of mutation programs deriving from seven original Q\# programs. The experimental results show that our testing methods can deal with broader types of quantum programs than existing ones and perform well on almost all faulty mutation programs.
Abstract Software testing is a critical component of the classical software development lifecycle, and this principle is expected to hold true for quantum software as it evolves toward large-scale production and adherence to industry standards. Developing and testing quantum software presents unique challenges due to the non-deterministic nature of quantum information, the high dimensionality of the underlying Hilbert space, complex hardware noise, and the inherent non-local properties of quantum systems. In this work, we propose a unifying theoretical framework based on probabilistic assertions, which encompasses several testing approaches—such as quantum tomography and statistical tests—for developing practical unit tests for quantum subroutines. The framework is built upon the semantic equivalence between quantum subroutines and parameterized quantum channels, as established in this work. To address the computational complexity associated with unit testing in quantum systems, we propose incorporating context-awareness into the testing process. The trade-offs between accuracy, state space coverage, and efficiency associated with the proposed theoretical framework for quantum unit testing have been demonstrated through its application to a simple three-qubit quantum subroutine that prepares a Greenberger–Horne–Zeilinger state, as well as to subroutines within a program implementing Shor’s algorithm.
Quantum computing has the potential to solve a wide variety of classically intractable problems. However, the inherent complexity, probabilistic behavior, and fragility of quantum systems pose significant challenges to ensuring the correctness and reliability of quantum programs. In this survey, we present a comprehensive overview of functional testing and validation techniques aimed at addressing these challenges for quantum circuits. We begin by outlining the unique characteristics of quantum systems that complicate traditional testing methodologies, including the absence of classical oracles, non-determinism due to quantum measurement, and the exponential growth of the state space. We then categorize and analyze a wide range of functional testing and validation techniques that have emerged to meet these challenges, including mutation testing, fuzz testing, and coverage testing. We further explore advanced semantic and white-box methods such as property-based testing, metamorphic testing, equivalence checking, fault testing, assertions, and concolic testing. Specifically, we discuss the applicability of these testing techniques to quantum circuits and examine their limitations in the current NISQ (Noisy Intermediate-Scale Quantum) era.
We present the architectural design and prototype implementation of QUT (Quantum Unit Testing), a framework for unit testing of quantum subroutines. The framework is developed with a focus on usability and simplicity, making the complex theoretical concepts behind quantum unit testing accessible to a wide range of users with diverse backgrounds. This is achieved through the implementation of polymorphic probabilistic assertions, whose evaluation methods adapt to the data types of the arguments used in assertion statements, which may vary according to the context-dependent semantics of quantum subroutines. These arguments can be represented as qubit measurement outcomes, density matrices, or Choi matrices. For each type, the architecture integrates a specific testing protocol - such as quantum process tomography, quantum state tomography, or Pearson's chi-squared test - while remaining flexible enough to incorporate additional protocols in the future. The framework is built on the Qiskit software stack, providing compatibility with a broad range of quantum hardware backends and simulation platforms. Drawing on the reasoning provided by the denotational semantics of quantum subroutines, this work also highlights the key distinctions between quantum unit testing and its classical counterpart.
As quantum computing transitions from theoretical concepts to commercially available quantum processing units, ensuring the quality, reliability, and correctness of quantum software systems has become paramount. The unique challenges of quantum software testing have necessitated the adaptation of classical software engineering techniques to the quantum domain. One such technique is fuzz testing, or fuzzing, an automated software testing technique that generates large volumes of inputs to identify bugs and unexpected behaviors. In this work we provide a comprehensive examination of how fuzz testing has been successfully applied to quantum computing. We analyze the application of fuzzing across the quantum ecosystem, from testing quantum programs to verifying quantum software stacks, quantum compilers, and quantum simulators. This survey establishes the foundation for understanding how fuzz testing can ensure the reliability and correctness of quantum software systems and outlines promising future research directions.
With recent breakthroughs in quantum computing, it has become a coming reality instead of a promising future. Quantum computing applications offer revolutionary potential across multiple domains including artificial intelligence (AI), optimization, healthcare, energy, and space, known as quantum advantage. The power of quantum computing relies on novel quantum algorithms, quantum software, and hardware. Unlike classical software, quantum software has unique features because of quantum mechanics such as superposition and noncloning. This opens a new research field - quantum software engineering (QSE). While the software engineering (SE) research community became aware of this need in 2019, we noticed the lack of a comprehensive investigation of state-of-the-art technologies and tools to improve quantum software quality. Testing and debugging are the two most efficient approaches to assure software quality in classical SE. In QSE, testing and debugging quantum programs become challenging due to quantum mechanics. While we can leverage some best practices from the classical world, new techniques and tools are needed to address the concerns in QSE. In this chapter, we first conduct a survey study of the state-of-the-art technologies and tools for testing and debugging quantum software. This study includes but is not limited to quantum bug pattern analysis and detection, quantum software testing techniques and classification, and quantum debugging techniques. In the second place, we provide our visions and insights of testing and debugging quantum software in terms of challenges and opportunities for improving quantum software quality. This survey has the potential to foster a research community committed to developing novel methods and tools for QSE.