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

基于SLM的自动化测试生成提示策略可持续性分析

Sustainability Analysis of Prompt Strategies for SLM-based Automated Test Generation

University Of Calgary(卡尔加里大学)

Pragati Kumari, Novarun Deb

AI总结:

本文研究了基于小语言模型的自动化测试生成中提示策略对计算和环境可持续性的影响,通过实验评估七种策略,发现策略选择对可持续性指标有显著影响,简单策略更环保。

摘要:

随着基于提示的自动化在软件测试中的普及,其计算和环境可持续性问题变得重要。现有AI驱动测试的可持续性研究主要关注大语言模型,忽略了提示工程策略,尤其是小语言模型(SLMs)的影响。本文首次系统评估了基于SLM的自动化测试生成中提示策略的可持续性。我们分析了三种开源SLMs下的七种提示策略,在受控实验设置下进行评估。评估同时考虑执行时间、token使用、能耗、碳排放和测试覆盖率质量,后者通过生成测试脚本的覆盖率分析评估。结果表明,提示策略对可持续性结果有显著影响,往往超过模型选择的影响。推理密集型策略如Chain of Thought和Self-Consistency虽然覆盖更高,但执行时间、能耗和碳排放显著增加。相比之下,简单策略如Zero-Shot和ReAct在测试覆盖率质量上具有竞争力,环境成本明显较低,而Least-to-Most和Program of Thought则提供平衡的权衡。

英文摘要:

The growing adoption of prompt-based automation in software testing raises important issues regarding its computational and environmental sustainability. Existing sustainability studies in AI-driven testing primarily focus on large language models, leaving the impact of prompt engineering strategies largely unexplored - particularly in the context of Small Language Models (SLMs). This gap is critical, as prompt design directly influences inference behavior, execution cost, and resource utilization, even when model size is fixed. To the best of our knowledge, this paper presents the first systematic sustainability evaluation of prompt engineering strategies for automated test generation using SLMs. We analyze seven prompt strategies across three open-source SLMs under a controlled experimental setup. Our evaluation jointly considers execution time, token usage, energy consumption, carbon emissions, and coverage test quality, the latter assessed through coverage analysis of the generated test scripts. The results show that prompt strategies have a substantial and independent impact on sustainability outcomes, often outweighing the effect of model choice. Reasoning intensive strategies such as Chain of Thought and Self-Consistency achieve higher coverage but incur significantly higher execution time, energy consumption, and carbon emissions. In contrast, simpler strategies such as Zero-Shot and ReAct deliver competitive coverage test quality with markedly lower environmental cost, while Least-to-Most and Program of Thought offer balanced trade-offs.

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

↑