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

提示覆盖充分性

Prompt Coverage Adequacy

SnT, University of Luxembourg(斯蒂尔夫研究所,卢森堡大学);University College London(伦敦大学学院);University of Luxembourg(卢森堡大学)

Florian Tambon, Michael Konstantinou, Cedric Richter, Charles Chenouard, Mark Harman, Mike Papadakis

AI总结:

提出提示覆盖充分性标准,通过注意力机制衡量测试套件对提示需求的覆盖,相比传统代码覆盖能多检测30%以上缺陷。

摘要:

近年来,越来越明显的是,大型语言模型(LLMs)和自主代理通过将重点从编写精确过程转移到表达意图和目标,提高了软件开发的抽象层次。这种范式转变带来了新的挑战,特别是在提示而非代码成为主要开发工件时,如何指导测试。为应对这一挑战,我们提出了提示覆盖充分性,一种新颖的覆盖标准,旨在支持从任务描述生成的代码的测试。提示覆盖充分性作为传统代码覆盖的类比,但在LLM和基于代理的编程中使用的提示级别上运行。具体来说,它通过利用LLM的注意力机制,衡量给定测试套件满足提示中表达的需求的程度。我们基于注意力增强,在两个数据集和多个LLM上评估了该标准的一个简单实例。我们的结果表明,提示覆盖与故障检测有效性相关,并且在用于指导测试生成时,可以比传统代码覆盖发现多30%以上的故障。这些发现表明,提示覆盖充分性可以作为开发更适合LLM驱动软件开发新兴范式的测试指标的基础,解决经典覆盖标准在此新背景下的局限性。

英文摘要:

In recent years, it has become increasingly evident that large language models (LLMs) and autonomous agents raise the level of abstraction in software development by shifting the focus from writing precise procedures to expressing intents and goals. This paradigm shift introduces new challenges, particularly in how testing should be guided when prompts, rather than code, become primary development artifacts. To address this challenge, we propose Prompt Coverage Adequacy, a novel coverage criterion designed to support the testing of code generated from task descriptions. Prompt Coverage Adequacy serves as an analog to traditional code coverage, but operates at the level of prompts used in LLM and agent-based programming. Specifically, it measures how well a given test suite satisfies the requirements expressed in a prompt by leveraging the attention mechanisms of LLMs. We evaluate a simple instantiation of this criterion, based on attention boosting, across two datasets and multiple LLMs. Our results demonstrate that Prompt Coverage is associated with fault-detection effectiveness and can uncover over 30+% more faults than traditional code coverage when used to guide test generation. These findings suggest that Prompt Coverage Adequacy can serve as a foundation for developing testing metrics better suited to the emerging paradigm of LLM-driven software development, addressing the limitations of classical coverage criteria in this new context.

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

↑