arXivDaily arXiv每日学术速递 周一至周五更新
北美退伍军人节(Veterans Day),12 日无更新
arXiv 2510.04494cs.HCcs.SE
收藏

NaturalEdit: 通过适应性自然语言表示直接交互进行代码修改

NaturalEdit: Code Modification through Direct Interaction with Adaptive Natural Language Representation

University of Notre Dame(圣母大学);Vanderbilt University(范德堡大学)

Ningzhi Tang, David Meininger, Gelei Xu, Yiyu Shi, Yu Huang, Collin McMillan, Toby Jia-Jun Li

AI总结:

NaturalEdit通过适应性自然语言表示与源代码紧密关联,提供灵活的抽象梯度,实现摘要与代码的交互映射,减少编辑粘性并保持可见性和一致性,提升开发者理解与验证能力。

摘要:

代码修改要求开发者理解代码、规划更改、表达意图并验证结果,这在认知上具有挑战性。虽然自然语言(NL)代码摘要提供了一种有前景的外部表示方法,但现有方法仍然有限。基于探索性数据分析的系统局限于狭窄领域,而通用系统强制使用固定的自然语言表示,并假设开发者可以直接将模糊的意图转化为精确的文本编辑。我们提出了NaturalEdit,它将自然语言代码摘要视为与源代码紧密关联的交互式表示。基于符号的认知维度,NaturalEdit引入了三个关键特性:(1)具有灵活抽象梯度的多方面代码摘要;(2)摘要与代码之间的交互映射机制,确保紧密且结构稳定的映射接近度;(3)意图驱动的双向同步,通过增量差异保持可见性和一致性,从而减少编辑粘性。技术评估证实了NaturalEdit的可行性,与20名开发者进行的用户研究显示,它提高了理解、意图表达和验证的能力,同时增加了开发者的信心和控制感。

英文摘要:

Code modification requires developers to comprehend code, plan changes, articulate intent, and validate outcomes, making it cognitively demanding. While natural language (NL) code summaries offer a promising external representation of this process, existing approaches remain limited. Systems grounded in exploratory data analysis are restricted to narrow domains, while general-purpose systems enforce fixed NL representations and assume that developers can directly translate vague intent into precise textual edits. We present NaturalEdit, which treats code summaries as interactive representations tightly linked to source code. Grounded in the Cognitive Dimensions of Notations, NaturalEdit introduces three key features: (1) adaptive, multi-faceted code summaries with a flexible Abstraction Gradient; (2) interactive mapping mechanisms between summaries and code that ensure tight, structurally stable Closeness of Mapping; and (3) intent-driven bidirectional synchronization that reduces Viscosity during editing while preserving Visibility and Consistency through incremental diffs. A technical evaluation confirms NaturalEdit's viability, and a user study with 20 developers shows that it improves comprehension, intent articulation, and validation while increasing developers' perceived confidence and control.

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

↑