Skip to main content
QUICK REVIEW

[论文解读] 9.6 Million Links in Source Code Comments: Purpose, Evolution, and Decay

Hideaki Hata, Christoph Treude|arXiv (Cornell University)|Jan 22, 2019
Software Engineering Research参考文献 43被引用 4
一句话总结

本研究分析了25,925个Git代码库中源代码注释里的960万条链接,以探究其普遍性、用途、演化过程及失效情况。研究发现,链接常用于许可证信息、文档引用和署名,但近10%的链接因目标地址变更或未及时更新而失效;在开源项目中,修复链接的拉取请求(pull requests)已被成功合并,凸显了此类链接的脆弱性,也凸显了需要更优工具来维护链接的必要性。

ABSTRACT

Links are an essential feature of the World Wide Web, and source code repositories are no exception. However, despite their many undisputed benefits, links can suffer from decay, insufficient versioning, and lack of bidirectional traceability. In this paper, we investigate the role of links contained in source code comments from these perspectives. We conducted a large-scale study of around 9.6 million links to establish their prevalence, and we used a mixed-methods approach to identify the links' targets, purposes, decay, and evolutionary aspects. We found that links are prevalent in source code repositories, that licenses, software homepages, and specifications are common types of link targets, and that links are often included to provide metadata or attribution. Links are rarely updated, but many link targets evolve. Almost 10% of the links included in source code comments are dead. We then submitted a batch of link-fixing pull requests to open source software repositories, resulting in most of our fixes being merged successfully. Our findings indicate that links in source code comments can indeed be fragile, and our work opens up avenues for future work to address these problems.

研究动机与目标

  • 理解真实世界软件代码库中源代码注释里链接的普遍性及其用途。
  • 研究链接及其目标随时间的演化过程,以及链接失效的程度。
  • 评估通过拉取请求在活跃开源项目中修复失效链接的可行性与影响。
  • 识别可支持工具改进代码注释中外部引用的可追溯性、版本控制和持久性的机会。

提出的方法

  • 使用支持7种编程语言的解析器,从25,925个Git代码库的源代码注释中收集了960万条链接。
  • 开展大规模定量分析,评估不同代码库中链接的普遍性与失效率。
  • 对1,146条抽样链接进行分层定性研究,以分类链接目标及其用途。
  • 分析提交历史,研究链接随时间的演化及目标地址的变化。
  • 向9个活跃的开源项目提交了9个修复链接的拉取请求,以评估实际修复的可行性与维护者的响应程度。
  • 结合定量与定性方法,评估链接失效、版本控制问题以及双向可追溯性缺口。

实验结果

研究问题

  • RQ1在真实世界的代码库中,源代码注释里的链接普遍性如何?
  • RQ2源代码注释中的链接通常指向哪些类型的资源?其主要用途是什么?
  • RQ3链接及其目标如何随时间演变?其失效程度如何?
  • RQ4在活跃的开源项目中,通过拉取请求修复源代码注释中的失效链接在多大程度上是可行的?

主要发现

  • 在所研究的25,925个代码库中,超过80%的代码库至少包含一条源代码注释中的链接,表明其使用非常广泛。
  • 许可证、软件主页和规范文档是最常见的链接目标类型。
  • 链接常被用于提供元数据或署名信息,但10%的链接因目标地址变更或不可用而失效。
  • 尽管更新频率较低,许多链接的目标仍发生了变化,这在很大程度上导致了链接失效。
  • 所有9个提交的修复链接拉取请求均被项目维护者成功合并,证明了此类修复的可行性和被接受度。
  • 研究揭示,由于缺乏版本控制和双向可追溯性,源代码注释中的链接极为脆弱,对文档维护和软件维护构成风险。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。