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

Java开发者如何在他们的GitHub项目中复用StackOverflow回答?

How Do Java Developers Reuse StackOverflow Answers in Their GitHub Projects?

Juntong Chen, Yan Zhao, Na Meng

AI总结:

本文通过克隆检测、关键词搜索和人工检查的混合方法,挖掘并研究了GitHub Java项目中复用的StackOverflow回答特征,发现被复用的回答得分更高、代码更长,且开发者多采用部分复用或重写而非完全复制。

摘要:

StackOverflow (SO) 是软件开发者和计算机科学家广泛使用的问答(Q&A)网站。GitHub 是一个在线开发平台,用于存储、跟踪和协作开发软件项目。先前的工作将两个平台挖掘出的信息关联起来,以链接用户账号或比较开发者在不同平台上的活动。然而,对于GitHub项目复用的SO回答进行特征刻画的研究还不多。在本文中,我们通过挖掘GitHub上可用的Java项目所复用的SO回答,进行了一项实证研究。我们创建了一种结合克隆检测、基于关键词搜索和人工检查的混合方法,以识别开发者实际利用的回答。基于识别出的回答,我们进一步研究了讨论线程的主题、回答特征(例如,得分、年龄、代码长度和文本长度)以及开发者的复用实践。我们观察到,大多数被复用的回答提供了实现特定编码任务的程序。在所有分析的SO讨论线程中,被复用的回答通常比未使用的回答具有相对更高的得分、更老的年龄、更长的代码和更长的文本。在仅9%的场景(40/143)中,开发者完全复制了回答代码进行复用。在其余场景中,他们复用部分代码或从头创建全新代码。我们的研究刻画了由357个GitHub项目中的Java开发者引用的130个SO讨论线程。我们的实证发现可以指导SO回答者提供更好的回答,并为未来与SO和GitHub相关的研究提供启示。

英文摘要:

StackOverflow (SO) is a widely used question-and-answer (Q\&A) website for software developers and computer scientists. GitHub is an online development platform used for storing, tracking, and collaborating on software projects. Prior work relates the information mined from both platforms to link user accounts or compare developers' activities across platforms. However, not much work is done to characterize the SO answers reused by GitHub projects. For this paper, we did an empirical study by mining the SO answers reused by Java projects available on GitHub. We created a hybrid approach of clone detection, keyword-based search, and manual inspection, to identify the answer(s) actually leveraged by developers. Based on the identified answers, we further studied topics of the discussion threads, answer characteristics (e.g., scores, ages, code lengths, and text lengths), and developers' reuse practices. We observed that most reused answers offer programs to implement specific coding tasks. Among all analyzed SO discussion threads, the reused answers often have relatively higher scores, older ages, longer code, and longer text than unused answers. In only 9% of scenarios (40/430), developers fully copied answer code for reuse. In the remaining scenarios, they reused partial code or created brand new code from scratch. Our study characterized 130 SO discussion threads referred to by Java developers in 357 GitHub projects. Our empirical findings can guide SO answerers to provide better answers, and shed lights on future research related to SO and GitHub.

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

↑