AI 中文总结
本研究在Python和JavaScript上复现Java相关研究,发现这两种语言的已采纳回答编辑率约为Java的2.5倍,且编辑数量随GitHub项目人气升高而增加,原研究结论可推广至Java之外。
AI 中文摘要
Stack Overflow的回答会被社区持续修订,其代码片段的编辑可能成为开源项目中复用代码的改进来源。近期一项实证研究针对Java得出该结论,报告称16.11%的已采纳Java回答被编辑,且生成的改进建议集中在高人气GitHub项目中。该行为是Stack Overflow平台的特性还是Java社区的特性,仍是未解决的问题。我们在与Java并列的两大广泛使用语言Python和JavaScript上复现该研究,采用相同的基于SOTorrent的提取流程、相同的克隆搜索工具Siamese+,以及相同的项目人气标准。分析840132个已采纳Python回答和1144185个已采纳JavaScript回答后,我们发现分别有41.25%和39.10%的回答至少被编辑过一次,约为Java比例的2.5倍,而每个被编辑回答的修订次数在三种语言间几乎一致,分别为2.78、2.68和2.82。在每种语言的100个GitHub项目中搜索后,我们发现两种语言中匹配的回答编辑数量均从低人气项目到中人气项目再到高人气项目单调递增,Python分别为80、156、977,JavaScript分别为32、71、353。该差异在Python中具有统计显著性,但在JavaScript中不具有。因此原研究的核心发现可推广至Java之外,两种复现语言的候选改进供应比原研究中的大得多。
英文摘要
Stack Overflow answers are continually revised by the community, and the edits made to their code snippets are a potential source of improvements for code that has been reused in open-source projects. A recent empirical study established this for Java, reporting that 16.11% of accepted Java answers are edited and that the resulting recommendations concentrate in highly popular GitHub projects. Whether that behaviour is a property of Stack Overflow or a property of the Java community has remained an open question. We replicate the study on Python and JavaScript, the two most widely used languages alongside Java, applying the same SOTorrent-based extraction pipeline, the same clone search tool, Siamese+, and the same project popularity criteria. Analysing 840,132 accepted Python answers and 1,144,185 accepted JavaScript answers, we find that 41.25% and 39.10% respectively have been edited at least once, roughly two and a half times the Java rate, while the number of revisions per edited answer is almost invariant across the three languages at 2.78, 2.68 and 2.82. Searching 100 GitHub projects per language, we find that the number of matched answer edits increases monotonically from low- to medium- to high-popularity projects in both languages, from 80 to 156 to 977 for Python and from 32 to 71 to 353 for JavaScript. The difference is statistically significant for Python but not for JavaScript. The central findings of the original study therefore generalise beyond Java, with the supply of candidate improvements considerably larger in both replication languages than in the original.