A Black-box Testing Framework for Oracle Quantum Programs
Peixun Long, Jianjun Zhao
TL;DR
The paper tackles the challenge of testing oracle quantum programs, a pivotal class that bridges quantum and classical computation. It defines a unified formal model for oracle programs and develops a black-box testing framework built on equivalence-class partitions, quantum input state design, and a Prepare-Run-Uncompute workflow to verify both output states and phases. A prototype tool and extensive experiments on benchmark programs demonstrate effective bug detection and correctness verification, with systematic analyses of repetition requirements and input-pairing strategies. The work advances quantum software reliability by providing a structured, language-agnostic testing approach that can guide developers and inform future tooling for quantum programming languages and hardware platforms.
Abstract
Oracle quantum programs are a fundamental class of quantum programs that serve as a critical bridge between quantum computing and classical computing. Many important quantum algorithms are built upon oracle quantum programs, making it essential to ensure their correctness during development. While software testing is a well-established approach for improving program reliability, no systematic method has been developed to test oracle quantum programs. This paper proposes a black-box testing framework designed for general oracle quantum programs. We define these programs formally, establish the foundational theory for their testing, and propose a detailed testing framework. We develop a prototype tool and conduct extensive experimental evaluations to evaluate the framework's effectiveness. Our results demonstrate that the proposed framework significantly aids developers in testing oracle quantum programs, providing insights to enhance the reliability of quantum software.
