arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.05128cs.SEcs.AIcs.LG
收藏

ChatGPT是一个优秀的软件库管理员吗?关于使用ChatGPT进行软件库推荐的探索性研究

Is ChatGPT a Good Software Librarian? An Exploratory Study on the Use of ChatGPT for Software Library Recommendations

Concordia University(康考迪亚大学);University of Calgary(卡尔加里大学)

Jasmine Latendresse, SayedHassan Khatoonabadi, Ahmad Abdellatif, Emad Shihab

AI总结:

本研究评估了ChatGPT作为软件库管理员的有效性,发现其推荐第三方库的频率高于人类开发者,但存在未明确提示限制性许可证及部分库无法开箱即用等问题,建议开发者加强依赖管理与许可证核查。

摘要:

软件库在软件系统的功能性、效率和可维护性方面发挥着关键作用。随着开发者越来越依赖大型语言模型(LLMs)来简化其编码过程,这些模型在推荐合适库方面的有效性变得至关重要,但在很大程度上仍未被探索。在本文中,我们评估了ChatGPT作为软件库管理员的有效性,并确定了需要改进的领域。我们使用GPT-3.5 Turbo进行了一项实证研究,为10,000个Stack Overflow问题生成Python代码。我们的研究结果表明,ChatGPT使用第三方库的频率比人类开发者高出近10%,且倾向于选择被广泛采用且成熟的选项。然而,14.2%的推荐库具有限制性的copyleft许可证,而ChatGPT并未明确说明这一点。此外,6.5%的库无法开箱即用,导致开发者可能产生困惑并浪费时间。尽管ChatGPT可以成为一名有效的软件库管理员,但仍需通过提供更明确的可维护性指标和许可信息来加以改进。我们建议开发者在将LLM生成的代码集成到其项目之前,实施严格的依赖管理实践,并仔细核查库的许可证。

英文摘要:

Software libraries play a critical role in the functionality, efficiency, and maintainability of software systems. As developers increasingly rely on Large Language Models (LLMs) to streamline their coding processes, the effectiveness of these models in recommending appropriate libraries becomes crucial yet remains largely unexplored. In this paper, we assess the effectiveness of ChatGPT as a software librarian and identify areas for improvement. We conducted an empirical study using GPT-3.5 Turbo to generate Python code for 10,000 Stack Overflow questions. Our findings show that ChatGPT uses third-party libraries nearly 10% more often than human developers, favoring widely adopted and well-established options. However, 14.2% of the recommended libraries had restrictive copyleft licenses, which were not explicitly communicated by ChatGPT. Additionally, 6.5% of the libraries did not work out of the box, leading to potential developer confusion and wasted time. While ChatGPT can be an effective software librarian, it should be improved by providing more explicit information on maintainability metrics and licensing. We recommend that developers implement rigorous dependency management practices and double-check library licenses before integrating LLM-generated code into their projects.

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

↑