计算机工程与应用 ›› 2023, Vol. 59 ›› Issue (24): 147-154.DOI: 10.3778/j.issn.1002-8331.2209-0442

• 模式识别与人工智能 • 上一篇    下一篇

用户评论中基于事件图谱的代码质量分析

张培园,姜瑛   

  1. 1.云南省计算机技术应用重点实验室,昆明 650500
    2.昆明理工大学 信息工程与自动化学院,昆明 650500
  • 出版日期:2023-12-15 发布日期:2023-12-15

Code Quality Analysis Based on Event Graph in User Reviews

ZHANG Peiyuan, JIANG Ying   

  1. 1.Yunnan Key Lab of Computer Technology Application, Kunming 650500, China
    2.Faculty of Information Engineering and Automation, Kunming University of Science and Technology, Kunming 650500, China
  • Online:2023-12-15 Published:2023-12-15

摘要: 对代码托管平台中的用户评论进行研究发现,用户评论中反映的代码质量信息可以帮助用户快速选择满足其需求的开源代码,并且可以帮助软件开发人员提高代码质量。但是当前研究存在代码质量信息提取不全面和不够准确的问题,为此提出一种基于事件图谱的代码质量分析方法来对用户评论中的代码质量信息进行分析。构建代码质量层次图表示多方面的代码质量信息结构;对用户评论进行分析,构建针对代码用户评论的事件图谱;提出将事件图谱映射为代码质量层次图的方法;对代码质量层次图中的代码质量信息进行识别。实验结果表明,该方法在代码评论文本中识别代码质量信息的平均准确率为86.9%,因此该方法能够对代码质量信息进行有效识别和分析。

关键词: 代码质量, 代码质量属性, 用户评论, 事件图谱

Abstract: Research on user comments in the code hosting platform shows that the code quality information reflected in user comments can help users quickly select open source code that meets their needs, and can help software developers improve code quality. However, in view of the problems of incomplete and inaccurate extraction of code quality information in current research, a code quality analysis method based on event graph is proposed to analyze the code quality information in user comments. Firstly, a code quality hierarchy diagram is constructed to represent the various code quality information structures. Then this paper analyzes user comments and builds an event map for code user comments. Secondly, the method of mapping event map to code quality hierarchy diagram is proposed. Finally, the code quality information in the code quality hierarchy diagram is identified. The experimental results show that the average accuracy of this method in identifying code quality information in code review texts is 86.9%, so this method can effectively identify and analyze code quality information.

Key words: code quality, code quality attributes, user comments, event map