arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2501.03639cs.DBcs.SE
收藏

一项关于人工智能在 LeetCode 与 ChatGPT 软件工程领域变革潜力的案例研究

A case study on the transformative potential of AI in software engineering on LeetCode and ChatGPT

Manuel Merkel, Jens Dörpinghaus

AI总结:

本文通过爬取和挖掘 LeetCode 数据,从质量、可理解性、运行时间与内存等指标比较 GPT-4o 与人类 Python 代码,发现其整体表现较好但泛化能力有限。

摘要:

近期生成式人工智能(GenAI)领域的迅猛发展,有可能给包括软件工程和教育在内的多个行业带来变革性变化。随着 OpenAI 的 ChatGPT 等 GenAI 工具在软件工程中得到越来越多的使用,理解这些技术对软件产品的影响已成为一项迫切任务。本研究采用包含从 LeetCode 进行网络爬取和数据挖掘在内的方法路径,旨在比较 LeetCode 用户编写的 Python 程序与 GPT-4o 生成的 Python 程序的软件质量。为深入理解这些问题,本研究探讨 GPT-4o 是否能够生成质量优于人类所编写软件的问题。研究结果表明,在有限规模内生成代码时,GPT-4o 不会对代码质量、可理解性或运行时间造成明显损害。事实上,与用户编写的代码相比,其生成代码在这三项指标上甚至表现出显著更低的数值。然而,与用户代码相比,生成代码在内存使用方面并未观察到显著更优的数值,这与预期相违背。此外,研究还将表明,GPTPT-4o 在泛化到未包含于训练数据集中的问题时遇到了挑战。本贡献呈现了首个基于 LeetCode 平台、依据代码质量、代码可理解性、时间行为和资源利用等多项度量,对生成代码与人类编写代码进行比较的大规模研究。所有数据均公开发布,以供进一步研究使用。

英文摘要:

The recent surge in the field of generative artificial intelligence (GenAI) has the potential to bring about transformative changes across a range of sectors, including software engineering and education. As GenAI tools, such as OpenAI's ChatGPT, are increasingly utilised in software engineering, it becomes imperative to understand the impact of these technologies on the software product. This study employs a methodological approach, comprising web scraping and data mining from LeetCode, with the objective of comparing the software quality of Python programs produced by LeetCode users with that generated by GPT-4o. In order to gain insight into these matters, this study addresses the question whether GPT-4o produces software of superior quality to that produced by humans. The findings indicate that GPT-4o does not present a considerable impediment to code quality, understandability, or runtime when generating code on a limited scale. Indeed, the generated code even exhibits significantly lower values across all three metrics in comparison to the user-written code. However, no significantly superior values were observed for the generated code in terms of memory usage in comparison to the user code, which contravened the expectations. Furthermore, it will be demonstrated that GPT-4o encountered challenges in generalising to problems that were not included in the training data set. This contribution presents a first large-scale study comparing generated code with human-written code based on LeetCode platform based on multiple measures including code quality, code understandability, time behaviour and resource utilisation. All data is publicly available for further research.

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

↑