Mutation Testing of Quantum Programs: A Case Study With Qiskit

As quantum computing is still in its infancy, there is an inherent lack of knowledge and technology to test a quantum program properly. In the classical realm, mutation testing has been successfully used to evaluate how well a program's test suite detects seeded faults (i.e., mutants). In...

Full description

Bibliographic Details
Main Authors: Daniel Fortunato, JOSE CAMPOS, RUI ABREU
Format: Article
Language:English
Published: IEEE 2022-01-01
Series:IEEE Transactions on Quantum Engineering
Subjects:
Online Access:https://ieeexplore.ieee.org/document/9844849/
_version_ 1818056491746197504
author Daniel Fortunato
JOSE CAMPOS
RUI ABREU
author_facet Daniel Fortunato
JOSE CAMPOS
RUI ABREU
author_sort Daniel Fortunato
collection DOAJ
description As quantum computing is still in its infancy, there is an inherent lack of knowledge and technology to test a quantum program properly. In the classical realm, mutation testing has been successfully used to evaluate how well a program's test suite detects seeded faults (i.e., mutants). In this article, building on the definition of syntactically equivalent quantum operations, we propose a novel set of mutation operators to generate mutants based on qubit measurements and quantum gates. To ease the adoption of quantum mutation testing, we further propose QMutPy, an extension of the well-known and fully automated open-source mutation tool MutPy. To evaluate QMutPy's performance, we conducted a case study on 24 real quantum programs written in IBM's Qiskit library. Furthermore, we show how better test suite coverage and improvements to test assertions can increase the test suites' mutation score and quality. QMutPy has proven to be an effective quantum mutation tool, providing insight into the current state of quantum tests and how to improve them.
first_indexed 2024-12-10T12:29:41Z
format Article
id doaj.art-65e78be622444266a6b2a33a1fd64390
institution Directory Open Access Journal
issn 2689-1808
language English
last_indexed 2024-12-10T12:29:41Z
publishDate 2022-01-01
publisher IEEE
record_format Article
series IEEE Transactions on Quantum Engineering
spelling doaj.art-65e78be622444266a6b2a33a1fd643902022-12-22T01:48:51ZengIEEEIEEE Transactions on Quantum Engineering2689-18082022-01-01311710.1109/TQE.2022.31950619844849Mutation Testing of Quantum Programs: A Case Study With QiskitDaniel Fortunato0https://orcid.org/0000-0003-2596-6859JOSE CAMPOS1RUI ABREU2https://orcid.org/0000-0003-3734-3157Faculty of Engineering, University of Porto, Porto, PortugalFaculty of Engineering, University of Porto, Porto, PortugalFaculty of Engineering, University of Porto, Porto, PortugalAs quantum computing is still in its infancy, there is an inherent lack of knowledge and technology to test a quantum program properly. In the classical realm, mutation testing has been successfully used to evaluate how well a program's test suite detects seeded faults (i.e., mutants). In this article, building on the definition of syntactically equivalent quantum operations, we propose a novel set of mutation operators to generate mutants based on qubit measurements and quantum gates. To ease the adoption of quantum mutation testing, we further propose QMutPy, an extension of the well-known and fully automated open-source mutation tool MutPy. To evaluate QMutPy's performance, we conducted a case study on 24 real quantum programs written in IBM's Qiskit library. Furthermore, we show how better test suite coverage and improvements to test assertions can increase the test suites' mutation score and quality. QMutPy has proven to be an effective quantum mutation tool, providing insight into the current state of quantum tests and how to improve them.https://ieeexplore.ieee.org/document/9844849/Quantum computingquantum mutation testingquantum software engineeringquantum software testing
spellingShingle Daniel Fortunato
JOSE CAMPOS
RUI ABREU
Mutation Testing of Quantum Programs: A Case Study With Qiskit
IEEE Transactions on Quantum Engineering
Quantum computing
quantum mutation testing
quantum software engineering
quantum software testing
title Mutation Testing of Quantum Programs: A Case Study With Qiskit
title_full Mutation Testing of Quantum Programs: A Case Study With Qiskit
title_fullStr Mutation Testing of Quantum Programs: A Case Study With Qiskit
title_full_unstemmed Mutation Testing of Quantum Programs: A Case Study With Qiskit
title_short Mutation Testing of Quantum Programs: A Case Study With Qiskit
title_sort mutation testing of quantum programs a case study with qiskit
topic Quantum computing
quantum mutation testing
quantum software engineering
quantum software testing
url https://ieeexplore.ieee.org/document/9844849/
work_keys_str_mv AT danielfortunato mutationtestingofquantumprogramsacasestudywithqiskit
AT josecampos mutationtestingofquantumprogramsacasestudywithqiskit
AT ruiabreu mutationtestingofquantumprogramsacasestudywithqiskit