arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.04810cs.SE
收藏

提示词中需求坏味的影响:自动化可追溯性案例研究

On the Impact of Requirements Smells in Prompts: The Case of Automated Traceability

Andreas Vogelsang, Alexander Korn, Giovanna Broccia, Alessio Ferrari, Jannik Fischbach, Chetan Arora

AI总结:

本文通过两个 LLM 的自动化需求—代码追踪实验,考察提示词中的需求坏味对性能的影响,发现其仅显著影响链接存在性判断,而不显著影响代码行级追踪。

摘要:

大型语言模型(LLM)正越来越多地用于生成软件制品,例如源代码、测试和追踪链接。需求在塑造引导 LLM 的输入提示词方面发挥着核心作用,因为它们常被用作提示词的一部分,以合成这些制品。然而,需求表述方式对 LLM 性能的影响仍不清楚。本文研究了需求坏味(requirements smells)——即歧义、不一致等潜在问题的指示标志——在用于 LLM 提示词时所起的作用。我们使用两个 LLM 开展实验,重点关注需求与代码之间的自动化追踪链接生成。结果呈现出混合效应:在预测某项需求是否在一段代码中得到实现(即是否存在追踪链接)时,需求坏味具有较小但显著的影响;而在将需求与相关代码行进行追踪时,未观察到显著影响。这些发现表明,需求坏味可能影响 LLM 在某些软件工程任务上的性能,但未必会对所有任务产生一致影响。我们强调需要进一步研究以理解这些细微差异,并提出未来工作方向:制定指南,以缓解 AI 驱动的软件工程过程中需求坏味的负面影响。

英文摘要:

Large language models (LLMs) are increasingly used to generate software artifacts, such as source code, tests, and trace links. Requirements play a central role in shaping the input prompts that guide LLMs, as they are often used as part of the prompts to synthesize the artifacts. However, the impact of requirements formulation on LLM performance remains unclear. In this paper, we investigate the role of requirements smells-indicators of potential issues like ambiguity and inconsistency-when used in prompts for LLMs. We conducted experiments using two LLMs focusing on automated trace link generation between requirements and code. Our results show mixed outcomes: while requirements smells had a small but significant effect when predicting whether a requirement was implemented in a piece of code (i.e., a trace link exists), no significant effect was observed when tracing the requirements with the associated lines of code. These findings suggest that requirements smells can affect LLM performance in certain SE tasks but may not uniformly impact all tasks. We highlight the need for further research to understand these nuances and propose future work toward developing guidelines for mitigating the negative effects of requirements smells in AI-driven SE processes.

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

↑