arXiv:2412.13386cs.SEcs.AI2024-12被引 4

用视觉草图生成代码,提升开发效率。

An Exploratory Study of ML Sketches and Visual Code Assistants

  • 将开发者草图输入大模型,自动转为Python代码。
  • 草图时间越长,生成代码质量越高,相关性显著。
  • 适合教育、原型设计和团队协作场景使用。

本文探索在集成开发环境(IDE)中引入视觉代码助手的可行性。软件工程中,白板草图常是编码前的关键协作步骤。尽管已有研究分析了草图模式及其实际应用,但如何直接利用草图生成代码的方法仍有限。随着具备视觉理解能力的大语言模型出现,这一差距得以弥合。我们构建了首个视觉代码助手原型,并对19名数据科学家进行实验,他们多数工作中会定期绘制草图。分析显示,52.6%的草图以图表为主,42.1%搭配列表,36.8%包含编号点。工具通过查询LLM将草图转化为Python笔记本。采用LLM作为评判者评估生成代码质量,发现即使简短草图也能生成有效代码框架。同时发现草图时间与代码质量呈正相关。通过深度访谈,我们评估了工具实用性,探讨了潜在应用场景,并理解开发者需求。参与者指出该类助手在教育、原型开发和协作环境中具有潜力。研究结果表明,下一代代码助手应整合视觉信息,既提升代码生成效果,也更好利用开发者现有草图习惯。

原文摘要 · Abstract (English)

This paper explores the integration of Visual Code Assistants in Integrated Development Environments (IDEs). In Software Engineering, whiteboard sketching is often the initial step before coding, serving as a crucial collaboration tool for developers. Previous studies have investigated patterns in SE sketches and how they are used in practice, yet methods for directly using these sketches for code generation remain limited. The emergence of visually-equipped large language models presents an opportunity to bridge this gap, which is the focus of our research. In this paper, we built a first prototype of a Visual Code Assistant to get user feedback regarding in-IDE sketch-to-code tools. We conduct an experiment with 19 data scientists, most of whom regularly sketch as part of their job. We investigate developers' mental models by analyzing patterns commonly observed in their sketches when developing an ML workflow. Analysis indicates that diagrams were the preferred organizational component (52.6%), often accompanied by lists (42.1%) and numbered points (36.8%). Our tool converts their sketches into a Python notebook by querying an LLM. We use an LLM-as-judge setup to score the quality of the generated code, finding that even brief sketching can effectively generate useful code outlines. We also find a positive correlation between sketch time and the quality of the generated code. We conclude the study by conducting extensive interviews to assess the tool's usefulness, explore potential use cases, and understand developers' needs. As noted by participants, promising applications for these assistants include education, prototyping, and collaborative settings. Our findings signal promise for the next generation of Code Assistants to integrate visual information, both to improve code generation and to better leverage developers' existing sketching practices.

代码生成视觉辅助AI开发

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。