Quantum computing has emerged as an innovative computational paradigm with great potential in various domains. As quantum computing advances, the development of high-quality quantum programs has become crucial, making it essential to ensure their reliability. Software testing plays a vital role in achieving the reliability and quality of software systems. Various testing strategies and tools have been proposed for traditional programs; however, research on testing methodologies for quantum programs is still in the early stages. Traditional testing techniques, while effective for classical programs, struggle to address the unique challenges posed by quantum programs, including inherent characteristics of quantum systems (such as superposition and entanglement), and the exponentially expanding input space as the number of qubits increases. Moreover, traditional testing strategies typically do not account for the hidden and non-deterministic failure patterns associated with input quantum bits (qubits), which, if recognized, could potentially lead to more efficient fault detection. Therefore, in this paper, we introduce a novel approach—Quantum Dynamic-Testing with Incremental Learning (QDT-IL), which aims to effectively capture and adapt to the failure patterns in quantum programs. QDT-IL employs an incremental learning model to learn from executed test cases and continuously updates its predictions on the failure tendencies for new test cases. By utilizing distance-based diversity metrics, QDT-IL strategically increases the variety of test cases, enabling targeted exploration of failure-prone regions in the input space. This combination of adaptive learning and diverse test case selection noticeably enhances the effectiveness and efficiency of quantum program testing. Experimental studies show that QDT-IL outperforms the baseline strategies, providing a more effective testing process for quantum programs.
Quantum computing has emerged as an innovative computational paradigm with great potential in various domains. As quantum computing advances, the development of high-quality quantum programs has become crucial, making it essential to ensure their reliability. Software testing plays a vital role in achieving the reliability and quality of software systems. Various testing strategies and tools have been proposed for traditional programs; however, research on testing methodologies for quantum programs is still in the early stages. Traditional testing techniques, while effective for classical programs, struggle to address the unique challenges posed by quantum programs, including inherent characteristics of quantum systems (such as superposition and entanglement), and the exponentially expanding input space as the number of qubits increases. Moreover, traditional testing strategies typically do not account for the hidden and non-deterministic failure patterns associated with input quantum bits (qubits), which, if recognized, could potentially lead to more efficient fault detection. Therefore, in this paper, we introduce a novel approach—Quantum Dynamic-Testing with Incremental Learning (QDT-IL), which aims to effectively capture and adapt to the failure patterns in quantum programs. QDT-IL employs an incremental learning model to learn from executed test cases and continuously updates its predictions on the failure tendencies for new test cases. By utilizing distance-based diversity metrics, QDT-IL strategically increases the variety of test cases, enabling targeted exploration of failure-prone regions in the input space. This combination of adaptive learning and diverse test case selection noticeably enhances the effectiveness and efficiency of quantum program testing. Experimental studies show that QDT-IL outperforms the baseline strategies, providing a more effective testing process for quantum programs.
Quantum Computing (QC) leverages quantum mechanics to manipulate quantum information, holding greater potential than classical computing. To fully exploit QC’s potential, it is crucial to ensure the reliability and quality of quantum programs. Research on quantum program testing is still at its early stage, in which some distinctive features of quantum programs, e.g., superposition and entanglement, may be overlooked, and the fault detection capability and testing effectiveness are rather limited. Besides, the input space of quantum programs may exponentially grow when the number of qubits increases, posing great challenges to testing quantum programs. It is imperative to develop a proper testing strategy to effectively select the potential failure-causing test cases and detect faults faster. In this paper, test cases with both basis states and superposition ones are considered and generated to cover more input space. A hybrid distance measurement method based on quantum fidelity and Hamming distance is presented for measuring the similarity among quantum test cases. Furthermore, a Dynamic Random Testing strategy based on Hybrid distance metrics (DRT-H) for quantum programs is proposed, which combines the hybrid distance metrics and the feedback mechanism of the classical Dynamic Random Testing (DRT) strategy to adjust the testing profile and guide the test case selection. Experimental studies demonstrate that the proposed DRT-H strategy outperforms the baseline testing strategies in most cases.
The capability of Quantum Computing (QC) in solving complex problems has been increasingly recognized. However, similar to classical computing, to fully exploit QC's potential, it is important to ensure the correctness of quantum programs. Doing so via software testing is, however, very challenging because of QC's inherent properties: superposition and entanglement. Towards the direction of ensuring the correctness of quantum programs, we propose an approach called QuCAT (QUantum CombinAtorial Testing) for systematic and automated testing of quantum programs by benefiting from combinatorial testing, which has been proven to be cost-effective in testing classical programs. QuCAT supports two combinatorial test suite generation scenarios, i.e., generating combinatorial test suites of a given strength, and incrementally generating and executing combinatorial test suites of increasing strength until a fault is found. The approach employs two types of test oracles to assess test results. We performed an empirical study with 18 faulty versions of quantum programs to evaluate QuCAT with strengths of two, three, and four in the two test generation scenarios. We compare the cost-effectiveness of combinatorial testing of various strengths and random testing (taken as baseline approach). Results show that combinatorial testing always performs better than random testing with the same cost and finds faults more quickly (in terms of required number of test cases). In addition, in most cases, combinatorial testing with a higher strength outperforms the lower strength in terms of effectiveness.
Quantum programs are designed to run on quantum computers, leveraging quantum circuits to solve problems that are intractable for classical machines. As quantum computing advances, ensuring the reliability of quantum programs has become increasingly important. This paper introduces NovaQ, a diversity-guided testing framework for quantum programs. NovaQ combines a distribution-based test case generator with a novelty-driven evaluation module. The generator produces diverse quantum state inputs by mutating circuit parameters, while the evaluator quantifies behavioral novelty based on internal circuit state metrics, including magnitude, phase, and entanglement. By selecting inputs that map to infrequently covered regions in the metric space, NovaQ effectively explores under-tested program behaviors. We evaluate NovaQ on quantum programs of varying sizes and complexities. Experimental results show that NovaQ consistently achieves higher test input diversity and detects more bugs than existing baseline approaches.
This thesis investigated how quantum test inputs can be generated in a more flexible and effective manner, addressing key challenges in quantum software testing related to the probabilistic nature of quantum computation, the size of the quantum state space, and the limitations of existing input generation techniques. To overcome these challenges, a generalized framework for constructing quantum input circuits was developed, supporting multiple generation strategies ranging from purely random single-qubit operations to structured entanglement-based circuits and hybrid combinations of both. The experimental evaluation demonstrated that the combined method that integrates both entanglement and random gate operations consistently achieved the highest fault detection rates across all tested programs. This indicates that hybrid circuit structures are better suited for exploring diverse quantum states and revealing distribution-level faults than methods relying solely on random or solely on entanglement-based constructions. The results also demonstrate the feasibility of using true quantum randomness for test input generation in quantum software testing. Although the evaluated programs were too small to expose clear differences between true quantum randomness and simulated randomness, the study shows that quantum-generated randomness can be practically integrated into the testing process. This provides a foundation for future work investigating its potential advantages for larger and more complex quantum programs. Moreover, our approach significantly outperforms the state-of-the-art approach, indicating its ability to explore the quantum state space more broadly. In addition to demonstrating the effectiveness of the proposed methods, this thesis contributes a unified framework that can serve as a foundation for future benchmarking and methodological development in quantum software testing. By enabling controlled comparisons between different circuit construction principles and randomness sources, the framework helps clarify how various input characteristics influence the ability to detect faults. This contributes to a deeper understanding of how quantum inputs should be designed to maximize test coverage and reliability. Overall, the findings of this thesis highlight the importance of combining structural diversity, entanglement, and randomness when generating quantum test inputs. They also show that true quantum randomness is a viable alternative to classical pseudo-randomness, performing on the same level as simulated methods while offering a more physically grounded source of uncertainty. As quantum hardware continues to evolve, the generalized approach presented here provides a flexible and extensible basis for developing more advanced test generation techniques, including guided search, hardware-aware input generation, and multi-objective optimization. These directions represent promising opportunities for future research aimed at improving the robustness and reliability of quantum software systems.
Quantum computing has the potential to revolutionize computation by leveraging phenomena such as superposition and entanglement. However, this potential is limited in practice by quantum noise, which introduces errors and uncertainty in current devices. This directly impacts the reliability of quantum software, making effective quantum software testing both essential and challenging. While existing quantum testing approaches adapt classical techniques, they largely rely on noise-free simulators and are therefore not reliably applicable to real computers, and often remain incompatible with modern quantum algorithms and error mitigation methods. This thesis addresses these limitations by investigating how quantum software testing can be made practical and reliable on real quantum computers. We identify key challenges in handling noise and in closing the gap between existing testing methodologies and recent advances in quantum computing. To enable testing under realistic conditions, we propose machine learning–based techniques, including QOIN and Q-LEAR, to reduce the impact of noise on test outcomes, allowing existing testing methods to be applied on real computers. We further introduce supporting tools such as QUIET and STGP to improve scalability and enhance noise modeling. In addition, we explore the integration of quantum components into classical testing scenarios, demonstrating applicability in hybrid systems. Extensive empirical evaluations across multiple platforms and real-world programs show significant mprovements in test reliability under noise. Furthermore, with QOPS and SB-QOPS, we propose a novel testing paradigm tailored for noisy quantum computers. Our approaches, QOPS and SB-QOPS, redefine test cases using Pauli strings, adopt expectation value–based oracles compatible with error mitigation techniques, and incorporate search-based strategies for efficient test generation. These methods support a broader class of programs, reduce dependence on complete specifications, and explicitly account for noise during testing. Large-scale studies, including experiments on real quantum hardware, demonstrate their effectiveness and scalability. Overall, this thesis advances quantum software testing by bridging the gap between theoretical methods and practical deployment on real quantum computers, enabling more reliable fault detection in the presence of quantum noise and laying a foundation for testing in the noisy quantum era.
Testing and debugging quantum software pose significant challenges due to the inherent complexities of quantum mechanics, such as superposition and entanglement. One challenge is indeterminacy, a fundamental characteristic of quantum systems, which increases the likelihood of flaky tests in quantum programs. To the best of our knowledge, there is a lack of comprehensive studies on quantum flakiness in the existing literature. In this paper, we present a novel machine learning platform that leverages multiple machine learning models to automatically detect flaky tests in quantum programs. Our evaluation shows that the extreme gradient boosting and decision tree-based models outperform other models (i.e., random forest, k-nearest neighbors, and support vector machine), achieving the highest F1 score and Matthews Correlation Coefficient in a balanced dataset and an imbalanced dataset, respectively. Furthermore, we expand the currently limited dataset for researchers interested in quantum flaky tests. In the future, we plan to explore the development of unsupervised learning techniques to detect and classify quantum flaky tests more effectively. These advancements aim to improve the reliability and robustness of quantum software testing.