arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.09134cs.SEcs.AI
收藏

面向所有人的更优Python编程:聚焦可维护性

Better Python Programming for all: With the focus on Maintainability

University of Oslo(奥斯陆大学)

Karthik Shivashankar, Antonio Martini

AI总结:

针对现有大语言模型生成Python代码可维护性受忽视的问题,研究通过专用数据集微调LLM进行代码重构,显著提升了代码可维护性,为AI辅助软件开发提供了新方向。

摘要:

本研究旨在提升大语言模型(LLM)生成代码的可维护性,研究聚焦Python编程语言。随着使用LLM提供编程辅助的场景日益增多,人们对其生成代码的可维护性的担忧也随之加剧。过往研究主要关注生成代码的功能准确性与测试通过率,却忽略了可维护性相关维度。\n 我们的方法采用了专门设计的数据集用于模型训练与评估,确保能对代码可维护性进行全面考量。本研究的核心是对LLM进行代码重构方向的微调,目标是提升代码可读性、降低复杂度并改善整体可维护性。\n 在对LLM进行以代码可维护性为优先目标的微调后,我们的评估结果显示,该模型显著提升了代码可维护性水平,为AI辅助软件开发的未来发展指明了一条颇具前景的方向。

英文摘要:

This study aims to enhance the maintainability of code generated by Large Language Models (LLMs), with a focus on the Python programming language. As the use of LLMs for coding assistance grows, so do concerns about the maintainability of the code they produce. Previous research has mainly concentrated on the functional accuracy and testing success of generated code, overlooking aspects of maintainability. Our approach involves the use of a specifically designed dataset for training and evaluating the model, ensuring a thorough assessment of code maintainability. At the heart of our work is the fine-tuning of an LLM for code refactoring, aimed at enhancing code readability, reducing complexity, and improving overall maintainability. After fine-tuning an LLM to prioritize code maintainability, our evaluations indicate that this model significantly improves code maintainability standards, suggesting a promising direction for the future of AI-assisted software development.

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

↑