跳到主要导航 跳到搜索 跳到主要内容

NameChecker: Detecting Inconsistency between Method Names and Method Bodies

  • Beijing Institute of Technology

科研成果: 书/报告/会议事项章节 › 会议稿件 › 同行评审

摘要

Methods are basic elements for functional organization in software applications. A high-quality method name should clearly express its function, and help developers understand its usages quickly without reading through the lengthy and complex method body. However, in some cases, method names could be inconsistent with their functional implementations. The inconsistency in turn may result in inaccurate interpretation of methods, and even buggy method invocations. To this end, in this paper, we propose a deep learning-based approach, called NameChecker, to detecting the inconsistency between method names and their corresponding method bodies. NameChecker extracts lexical and structural features of source code by static code analysis. Based on the extracted features, NameChecker employs deep learning techniques (i.e., LSTM, and Attention mechanism) to predict whether the given method name is consistent with its implementation. Different from other deep learning based approaches to inconsistency detection, NameChecker avoids the generation (recommendation) of method names. Empirical studies suggested that generated method names are often incorrect, and thus avoiding method name generation may significantly improve the accuracy of NameChecker. We evaluate NameChecker on open-source applications, and our evaluation results suggest that NameChecker improves the state of the art by increasing the F1-score from 66.7% to 73.4%.

源语言英语
主期刊名Proceedings - 2021 28th Asia-Pacific Software Engineering Conference, APSEC 2021
出版商IEEE Computer Society
页22-31
页数10
ISBN(电子版)9781665437844
DOI
出版状态已出版 - 2021
活动28th Asia-Pacific Software Engineering Conference, APSEC 2021 - Virtual, Online, 中国台湾
期限: 6 12月 2021 → 9 12月 2021

丛书

姓名Proceedings - Asia-Pacific Software Engineering Conference, APSEC
卷2021-December
ISSN(印刷版)1530-1362

会议

会议28th Asia-Pacific Software Engineering Conference, APSEC 2021
国家/地区中国台湾
市Virtual, Online
时期6/12/21 → 9/12/21

学术指纹

探究 'NameChecker: Detecting Inconsistency between Method Names and Method Bodies' 的科研主题。它们共同构成独一无二的学术指纹。

引用此