arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2107.04521cs.SEcs.PL
收藏

如何识别类注释类型?一种用于类注释分类的多语言方法

How to Identify Class Comment Types? A Multi-language Approach for Class Comment Classification

Pooja Rani, Sebastiano Panichella, Manuel Leuenberger, Andrea Di Sorbo, Oscar Nierstrasz

AI总结:

本文针对Python、Java和Smalltalk类注释实践差异及注释不足问题,结合NLP与文本分析自动识别类注释语义类型,并构建跨语言分类体系,实现高准确率分类。

摘要:

大多数软件维护和演化任务都要求开发者理解其软件系统的源代码。无论使用何种编程语言,软件开发者通常都会查看类注释,以获取有关程序行为的知识。遗憾的是:(i)不同编程语言具有特定于语言的代码注释记法或指南;(ii)软件项目的源代码往往缺少能够充分描述类行为的注释,这使程序理解和演化活动变得复杂。为应对这些挑战,本文研究了三种编程语言——Python、Java和Smalltalk——中不同的、特定于语言的类注释实践。具体而言,我们系统分析了在以这些语言开发的项目的类注释中所发现信息类型的异同。我们提出一种方法,利用自然语言处理和文本分析两种技术,从类注释中自动识别各类信息,即类注释中发现的特定语义信息类型。据我们所知,此前没有工作借助一种通用的自动化方法,为这三种编程语言提供全面的类注释类型分类体系。我们的结果证实,对于Python、Java和Smalltalk编程语言,该方法能够以较高准确率对常见的类注释信息类型进行分类。我们认为,这项工作有助于监测和评估不同编程语言中代码注释的质量与演化,从而支持维护和演化任务。

英文摘要:

Most software maintenance and evolution tasks require developers to understand the source code of their software systems. Software developers usually inspect class comments to gain knowledge about program behavior, regardless of the programming language they are using. Unfortunately, (i) different programming languages present language-specific code commenting notations/guidelines; and (ii) the source code of software projects often lacks comments that adequately describe the class behavior, which complicates program comprehension and evolution activities. To handle these challenges, this paper investigates the different language-specific class commenting practices of three programming languages: Python, Java, and Smalltalk. In particular, we systematically analyze the similarities and differences of the information types found in class comments of projects developed in these languages. We propose an approach that leverages two techniques, namely Natural Language Processing and Text Analysis, to automatically identify various types of information from class comments i.e., the specific types of semantic information found in class comments. To the best of our knowledge, no previous work has provided a comprehensive taxonomy of class comment types for these three programming languages with the help of a common automated approach. Our results confirm that our approach can classify frequent class comment information types with high accuracy for Python, Java, and Smalltalk programming languages. We believe this work can help to monitor and assess the quality and evolution of code comments in different program languages, and thus support maintenance and evolution tasks.

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

↑