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

LLMs能否产生比人类参与开发更好的面向对象设计?

Can LLMs Produce Better Object-Oriented Designs than Human-Involved Development?

University of Auckland(奥克兰大学)

Zushuai Zhang, Elliott Wen, Ewan Tempero

AI总结:

本文研究了LLMs在生成面向对象设计(OOD)项目时的表现,通过比较预AI、后AI和纯AI三种作者条件下的项目质量,发现纯AI项目在代码异味密度和整体复杂度上较低,但存在过度简化的问题,结论指出在使用LLMs进行面向对象设计时,适当的人类指导仍很重要。

摘要:

背景:大型语言模型(LLMs)越来越多地用于代码生成。然而,它们生成需要面向对象设计(OOD)的多类项目的能力仍不明确,尤其是与人类参与开发的项目相比。目标:本研究的主要目标是比较三种作者条件下的OOD质量:预AI(在广泛使用LLM之前由人类参与开发的项目)、后AI(在广泛使用LLM之后由人类参与开发的项目)和纯AI(由当代LLMs端到端生成的项目)。方法:我们对一个研究生Java作业进行了比较案例研究。选择两个相同的作业提供作为预AI和后AI数据集。纯AI项目使用三个当代LLMs生成。我们使用项目级OOD度量、代码异味密度和领域建模分析OOD质量。结果:与人类参与的项目相比,纯AI项目在代码异味密度上较低,总体大小、复杂度和耦合度上通常更简单。然而,这与过度简化一致,因为它与缺失的抽象和较弱的责任分离相关。后AI在许多OOD度量上比预AI更接近纯AI,也显示出向过度简化发展的趋势。结论:我们的发现表明,当使用LLMs进行面向对象设计时,适当的由人类指导面向对象分解和责任分配仍然很重要。

英文摘要:

Background: Large Language Models (LLMs) are increasingly used for code generation. However, their ability to generate multi-class projects that require object-oriented design (OOD) remains unclear, especially relative to projects developed with human involvement. Aims: The primary objective of this study is to compare OOD quality in projects from three authorship conditions: PreAI (human-involved projects produced before widespread LLM use), PostAI (human-involved projects produced after widespread LLM use), and PureAI (projects generated end-to-end by contemporary LLMs). Method: We conducted a comparative case study on a postgraduate Java assignment. Two offerings of the same assignment were selected as the PreAI and PostAI datasets. PureAI projects were generated using three contemporary LLMs. We analyzed OOD quality using project-level OOD metrics, code smell density, and domain modeling. Results: Relative to human-involved projects, PureAI projects show lower code smell density and generally appear simpler in terms of total size, complexity, and coupling. However, this is consistent with oversimplification, as it is associated with missing abstractions and weaker responsibility separation. PostAI is closer to PureAI than PreAI on many OOD measures and also shows tendencies toward oversimplification. Conclusions: Our findings indicate that appropriate human guidance on object-oriented decomposition and responsibility assignment remains important when LLMs are used for object-oriented design.

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

↑