arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.10179cs.SEcs.AI
收藏

LLMs就是你所需要的全部?利用大型语言模型改进MOJO的模糊测试

LLMs are All You Need? Improving Fuzz Testing for MOJO with Large Language Models

School of Electrical and Computer Engineering, University of Sydney(悉尼大学电气与计算机工程学院)

Linghan Huang, Peizhou Zhao, Huaming Chen

AI总结:

针对新兴语言MOJO缺乏测试框架和语料库导致LLM幻觉降低模糊测试效果的问题,提出首个基于LLM的自适应模糊测试框架MOJOFuzzer,通过多阶段过滤和运行时反馈迭代变异,显著提升了测试有效性及覆盖率,并发现13个未知错误。

摘要:

大型语言模型(LLMs)的快速发展通过自动化生成多样且有效的测试输入,彻底改变了软件测试,尤其是模糊测试。这一进步为提升软件可靠性带来了巨大希望。同时,MOJO作为一种结合了Python的易用性与C和C++效率的高性能AI编程语言,其引入为增强AI模型的可扩展性和可编程性提供了新机遇。然而,作为一种新语言,MOJO缺乏全面的测试框架和用于基于LLM测试的充足语料库,这加剧了模型幻觉。在这种情况下,LLMs会生成语法有效但语义不正确的代码,显著降低了模糊测试的有效性。为了应对这一挑战,我们提出了MOJOFuzzer,这是第一个专为新兴编程语言的零样本学习环境设计的基于LLM的自适应模糊测试框架。MOJOFuzzer集成了一个多阶段框架,在执行前系统性地消除低质量的生成输入,显著提高了测试用例的有效性。此外,MOJOFuzzer根据运行时反馈动态调整LLM提示以进行测试用例变异,实现了一个持续提升模糊测试效率和错误检测性能的迭代学习过程。我们的实验结果表明,MOJOFuzzer显著提升了测试有效性、API覆盖率和错误检测性能,优于传统模糊测试和最先进的基于LLM的模糊测试方法。使用MOJOFuzzer,我们对MOJO进行了首次大规模模糊测试评估,发现了13个此前未知的错误。本研究不仅推进了LLM驱动的软件测试领域,还为在新兴编程语言测试中利用LLM确立了基础性方法论。

英文摘要:

The rapid development of large language models (LLMs) has revolutionized software testing, particularly fuzz testing, by automating the generation of diverse and effective test inputs. This advancement holds great promise for improving software reliability. Meanwhile, the introduction of MOJO, a high-performance AI programming language blending Python's usability with the efficiency of C and C++, presents new opportunities to enhance AI model scalability and programmability. However, as a new language, MOJO lacks comprehensive testing frameworks and a sufficient corpus for LLM-based testing, which exacerbates model hallucination. In this case, LLMs will generate syntactically valid but semantically incorrect code, significantly reducing the effectiveness of fuzz testing. To address this challenge, we propose MOJOFuzzer, the first adaptive LLM-based fuzzing framework designed for zero-shot learning environments of emerging programming languages. MOJOFuzzer integrates a mutil-phase framework that systematically eliminates low-quality generated inputs before execution, significantly improving test case validity. Furthermore, MOJOFuzzer dynamically adapts LLM prompts based on runtime feedback for test case mutation, enabling an iterative learning process that continuously enhances fuzzing efficiency and bug detection performance. Our experimental results demonstrate that MOJOFuzzer significantly enhances test validity, API coverage, and bug detection performance, outperforming traditional fuzz testing and state-of-the-art LLM-based fuzzing approaches. Using MOJOFuzzer, we have conducted a first large-scale fuzz testing evaluation of MOJO, uncorvering 13 previous unknown bugs. This study not only advances the field of LLM-driven software testing but also establishes a foundational methodology for leveraging LLMs in the testing of emerging programming languages.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑