Table of Contents
Fetching ...

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

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

TL;DR

NaturalEdit reframes code modification as an interactive workflow centered on adaptive natural-language representations of code. It delivers three core capabilities—adaptive NL abstraction, explicit NL-code mapping, and intent-driven bidirectional synchronization—implemented as a VS Code extension powered by GPT-4.1. Through a technical benchmark and a controlled user study with 12 developers, the approach proves technically viable and yields measurable gains in comprehension, intent articulation, and perceived control, while also highlighting task-dependent variations in performance. The work offers actionable design guidance for building NL-centric programming tools and demonstrates how structured, interactive NL artifacts can align developer cognition with code evolution.

Abstract

Code modification requires developers to comprehend code, plan changes, articulate intentions, and validate outcomes, making it a cognitively demanding process. Generated natural language code summaries aid comprehension but remain static and limited in supporting the full workflow. We present NaturalEdit, a system that makes code summaries interactive and adaptive representations directly linked to source code. Grounded in the Cognitive Dimensions of Notations, NaturalEdit implements a paradigm of code modification through interaction with natural language representations through three key features: (1) adaptive multi-faceted representation of code summaries with flexible Abstraction Gradient; (2) interactive mapping mechanisms between summaries and codes, ensuring a tight Closeness of Mapping; and (3) intent-driven, bidirectional synchronization that reduces Viscosity in editing and validation. A technical evaluation confirms the performance of NaturalEdit, and a user study with 12 developers shows that it enhances comprehension, intent articulation, and validation, giving developers greater confidence and control.

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

TL;DR

NaturalEdit reframes code modification as an interactive workflow centered on adaptive natural-language representations of code. It delivers three core capabilities—adaptive NL abstraction, explicit NL-code mapping, and intent-driven bidirectional synchronization—implemented as a VS Code extension powered by GPT-4.1. Through a technical benchmark and a controlled user study with 12 developers, the approach proves technically viable and yields measurable gains in comprehension, intent articulation, and perceived control, while also highlighting task-dependent variations in performance. The work offers actionable design guidance for building NL-centric programming tools and demonstrates how structured, interactive NL artifacts can align developer cognition with code evolution.

Abstract

Code modification requires developers to comprehend code, plan changes, articulate intentions, and validate outcomes, making it a cognitively demanding process. Generated natural language code summaries aid comprehension but remain static and limited in supporting the full workflow. We present NaturalEdit, a system that makes code summaries interactive and adaptive representations directly linked to source code. Grounded in the Cognitive Dimensions of Notations, NaturalEdit implements a paradigm of code modification through interaction with natural language representations through three key features: (1) adaptive multi-faceted representation of code summaries with flexible Abstraction Gradient; (2) interactive mapping mechanisms between summaries and codes, ensuring a tight Closeness of Mapping; and (3) intent-driven, bidirectional synchronization that reduces Viscosity in editing and validation. A technical evaluation confirms the performance of NaturalEdit, and a user study with 12 developers shows that it enhances comprehension, intent articulation, and validation, giving developers greater confidence and control.

Paper Structure

This paper contains 67 sections, 15 figures, 3 tables.

Figures (15)

  • Figure 1: The adaptive, multi-faceted NL representation in NaturalEdit features a concise Title that summarizes the function's purpose. It is adjustable along two orthogonal dimensions: (1) Structure , toggling between a paragraph and bulleted format ; and (2) Granularity , scaling from a high-level overview , to a procedural summary , to a line-by-line explanation .
  • Figure 2: Interactive cross-representation mapping in NaturalEdit. As the user's cursor moves from one semantic segment (e.g., have been members... in the left panel) to another (e.g., formats each... in the right panel), the system dynamically updates the corresponding code highlight.
  • Figure 3: Intent-driven bi-directional synchronization in NaturalEdit, where developer actions are shown as solid arrows and system actions as dashed arrows . The workflow connects intent articulation, NL refinement, code modification, and global/local validation into a cohesive loop.
  • Figure 4: The user interface and key steps of the example workflow. The developer begins by summarizing the code (A), interacts with the NL representation (B), provides an instruction (C), validates the proposed NL change (D), reviews the updated summary and code in a visual diff (E), and reverts unintended code changes (F).
  • Figure 5: Pass@1 accuracy of our NL-mediated workflows (blue and red lines) against the Direct Instruction baseline (dashed gray line), evaluated on CanItEdit (using both Lazy and Descriptive instructions) and EditEval benchmarks.
  • ...and 10 more figures