Metamorphic Testing of Quantum Query Algorithms
Abstract Testing quantum programs remains challenging due to probabilistic measurement and the difficulty of establishing reliable test oracles. Although metamorphic testing, MT, has been explored in quantum software, its fault-detection effectiveness and input requirements remain insufficiently investigated. To address these challenges, we propose six metamorphic relations, MRs, for three quantum query algorithms: Deutsch-Jozsa, Bernstein-Vazirani, and Simon. We introduce a testing structure that translates these relations into executable tests and integrates with QCRMut to automate mutant generation, test execution, and evaluation. Some MRs also allow checks before measurement, minimising dependence on statistical analysis of measurement outcomes. We systematically evaluate the validity and fault-detection effectiveness of the proposed MRs through three experiments. Exhaustive evaluation confirms their validity for the selected configurations, with mutation scores ranging from 41.80% to 83.59%. We then investigate input reduction across 20 random selections per configuration, finding that all selections reproduce their exhaustive mutation scores within 15 inputs. Finally, we examine larger configurations without exhaustive reference scores, observing mutation-score stabilisation within the evaluated range. These findings demonstrate the fault-detection capability of the proposed MRs and show that reduced input sets can preserve this effectiveness, supporting MT as a promising approach when exhaustive evaluation becomes computationally impractical.
Authors
- José Ignacio Requeno (ORCID: https://orcid.org/0000-0001-5111-8357)
- Luis Llana
- Sinhué García-Gil
Institutions
- Universidad Complutense de Madrid (ES)
Publication Details
- Journal
- Research Square
- Published
- 2026-11-12
- DOI
- https://doi.org/10.21203/rs.3.rs-11469178/v1
- Primary Topic
- Software Testing and Debugging Techniques
- Type
- preprint
Funders
- Banco Santander
- Comunidad de Madrid
- Universidad Complutense de Madrid
- Ministerio de Ciencia e Innovación
- Agencia Estatal de Investigación