arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2209.08165cs.SE
收藏

代码注释质量评估的十年:系统文献综述

A Decade of Code Comment Quality Assessment: A Systematic Literature Review

Pooja Rani, Arianna Blasi, Nataliia Stulova, Sebastiano Panichella, Alessandra Gorla, Oscar Nierstrasz

AI总结:

本文通过系统文献综述分析近十年代码注释质量评估研究,梳理注释类型、质量属性、工具技术与评估方式,揭示 Java 偏向、属性集中及自动化不足等问题。

摘要:

代码注释是软件系统中的重要制品,在许多与维护和程序理解相关的软件工程(SE)任务中发挥着至关重要的作用。然而,尽管高质量对于代码注释和源代码同样重要这一点已被广泛接受,但在实践中评估注释质量仍然是一个悬而未决的问题。首先,在评估代码注释时,并不存在唯一的质量定义。少数关于该主题的现有研究反而聚焦于易于量化和测量的特定质量属性。现有技术及相应工具也可能聚焦于绑定特定编程语言的注释,并且可能只处理具有特定范围和明确目标的注释(例如,方法级别的 Javadoc 注释,或描述待处理 TODO 的函数体内注释)。在本文中,我们对过去十年的 SE 研究进行了一项系统文献综述(SLR),以回答以下研究问题:(i)研究人员在评估注释质量时关注哪些类型的注释?(ii)他们考虑哪些质量属性(QAs)?(iii)他们使用哪些工具和技术来评估注释质量?以及(iv)总体而言,他们如何评估其关于注释质量评估的研究?我们的评估基于对 2353 篇论文的分析以及对其中 47 篇相关论文的实际综述,结果表明:(i)大多数研究和技术聚焦于 Java 代码中的注释,因此可能无法推广到其他语言;(ii)所分析的研究聚焦于文献中识别出的共 21 个 QAs 中的四个主要 QAs,其中明显占主导地位的是检查注释与代码之间的一致性。我们观察到,研究人员依赖人工评估和特定启发式方法,而不是对注释质量属性进行自动化评估。

英文摘要:

Code comments are important artifacts in software systems and play a paramount role in many software engineering (SE) tasks related to maintenance and program comprehension. However, while it is widely accepted that high quality matters in code comments just as it matters in source code, assessing comment quality in practice is still an open problem. First and foremost, there is no unique definition of quality when it comes to evaluating code comments. The few existing studies on this topic rather focus on specific attributes of quality that can be easily quantified and measured. Existing techniques and corresponding tools may also focus on comments bound to a specific programming language, and may only deal with comments with specific scopes and clear goals (e.g., Javadoc comments at the method level, or in-body comments describing TODOs to be addressed). In this paper, we present a Systematic Literature Review (SLR) of the last decade of research in SE to answer the following research questions: (i) What types of comments do researchers focus on when assessing comment quality? (ii) What quality attributes (QAs) do they consider? (iii) Which tools and techniques do they use to assess comment quality?, and (iv) How do they evaluate their studies on comment quality assessment in general? Our evaluation, based on the analysis of 2353 papers and the actual review of 47 relevant ones, shows that (i) most studies and techniques focus on comments in Java code, thus may not be generalizable to other languages, and (ii) the analyzed studies focus on four main QAs of a total of 21 QAs identified in the literature, with a clear predominance of checking consistency between comments and the code. We observe that researchers rely on manual assessment and specific heuristics rather than the automated assessment of the comment quality attributes.

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

↑