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

基于堆栈溢出答案编辑推荐代码改进

Recommending Code Improvements Based on Stack Overflow Answer Edits

Chaiyong Ragkhitwetsagul, Matheus Paixao

摘要:

背景:次优代码在软件系统中普遍存在。开发人员可能会由于许多原因编写低质量的代码,例如缺乏技术知识,缺乏经验,时间压力,管理决策,甚至不快乐。一旦次优代码在不知不觉中(或有意)集成到软件系统的代码库中,其积累可能会导致大量的维护成本和技术债务。Stack Overflow是一个程序员提问和分享代码片段的流行网站。Stack Overflow的众包和协作性质创造了大量的编程知识来源,可以用来帮助开发人员进行日常活动。目的:在本文中,我们提出了一个探索性的研究,以评估基于Stack Overflow答案的编辑推荐代码改进的有用性。方法:我们提出了Matcha,一个代码推荐工具,利用Stack Overflow代码片段与版本历史和代码克隆搜索技术来识别软件项目中的次优代码,并建议其优化版本。通过使用SOTorrent和GitHub数据集,我们将定性定量地研究\textsc{Matcha}向开发人员提供的建议的有用性,这些建议使用手动分类的建议和接受开源项目的拉式请求。

英文摘要:

Background: Sub-optimal code is prevalent in software systems. Developers may write low-quality code due to many reasons, such as lack of technical knowledge, lack of experience, time pressure, management decisions, and even unhappiness. Once sub-optimal code is unknowingly (or knowingly) integrated into the codebase of software systems, its accumulation may lead to large maintenance costs and technical debt. Stack Overflow is a popular website for programmers to ask questions and share their code snippets. The crowdsourced and collaborative nature of Stack Overflow has created a large source of programming knowledge that can be leveraged to assist developers in their day-to-day activities. Objective: In this paper, we present an exploratory study to evaluate the usefulness of recommending code improvements based on Stack Overflow answers' edits. Method: We propose Matcha, a code recommendation tool that leverages Stack Overflow code snippets with version history and code clone search techniques to identify sub-optimal code in software projects and suggest their optimised version. By using SOTorrent and GitHub datasets, we will quali-quantitatively investigate the usefulness of recommendations given by \textsc{Matcha} to developers using manual categorisation of the recommendations and acceptance of pull-requests to open-source projects.

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

↑