发表机构
Shanghai Jiao Tong University; Nanyang Technological University; Hong Kong University of Science and Technology; Zhejiang University of Technology; College of Computing and Data Science; School of Physical and Mathematical Sciences(上海交通大学; 南洋理工大学; 香港科技大学; 浙江工业大学; 计算与数据科学学院; 物理与数学科学学院)
机构由 AI 辅助整理,请以论文原文为准。AI 中文总结
针对量子库模糊测试灵活性和效率不足问题,提出KQFuzz,利用代码库知识结合适应度引导评估与两级变异,实现高质量测试生成。在三个量子库上测试效果显著优于其他方法,发现多个错误,推动量子计算领域发展。
AI 中文摘要
随着量子计算不断发展,确保量子库的可靠性和正确性愈发关键。为此,已提出许多基于大语言模型的量子库模糊测试方法,但仍存在灵活性不足和效率低等局限。本文提出KQFuzz,一种新颖的量子库知识引导模糊测试器。它利用综合代码库知识为基于大语言模型的测试生成提供基础,结合适应度引导评估和两级变异来探索复杂执行路径并触发潜在错误。首先介绍了针对量子程序的新颖提示方案,还开发了评估和变异策略。在三个流行量子库上实现并测试,结果表明其显著优于其他方法,覆盖度提高达18.44%,且发现了13个错误,12个已被开发者修复。
英文摘要
As quantum computing continually improves, ensuring the reliability and correctness of quantum libraries has become increasingly critical. To this end, many LLM-based fuzzing approaches towards quantum libraries have been proposed to uncover potential bugs. However, these methods still suffer from limitations such as insufficient flexibility and low efficiency, which hinder the progress of the quantum computing field. To address these challenges, we propose KQFuzz, a novel knowledge-guided fuzzer for quantum libraries. It leverages comprehensive codebase knowledge to ground LLM-based test generation, synergizing this with fitness-guided evaluation and two-level mutations to explore complex execution paths and trigger potential bugs. Firstly, KQFuzz introduces a novel prompting scheme tailored to quantum programs, which strategically incorporates knowledge of the codebase to efficiently generate high-quality quantum seed programs. Moreover, we develop evaluation and mutation strategies to handle the generated seed programs, facilitating efficient fuzzing execution while further enriching the diversity of the resulting test cases. We implement KQFuzz and conduct fuzzing on three popular quantum libraries, including Qiskit, PennyLane, and Cirq. Experimental results demonstrate that our approach significantly outperforms other state-of-the-art methods, with coverage improved by up to 18.44%. During the development of KQFuzz, we discovered 13 bugs, all of which have been confirmed and 12 have already been fixed by the developers.
CommentsAccepted to the 41st IEEE/ACM International Conference on Automated Software Engineering. 17 pages, 9 figures. Comments are welcome