Write a Blog >>
ICSE 2020
Wed 24 June - Thu 16 July 2020
Tue 7 Jul 2020 15:24 - 15:36 at Silla - A3-Code Summarization Chair(s): Shaohua Wang

Misleading names of the methods in a project or the APIs in a software library confuse developers about program functionality and API usages, leading to API misuses and defects. In this paper, we introduce MNIRE, a machine learning approach to check the consistency between the name of a given method and its implementation. MNIRE first generates a candidate name and compares the current name against it. If the two names are sufficiently similar, we consider the method as consistent. To generate the method name, we draw our ideas and intuition from an empirical study on the nature of method names in a large dataset. Our key findings are that high proportions of the tokens of method names can be found in the three contexts of a given method including its body, the interface (the method’s parameter types and return type), and the enclosing class’ name. Even when such tokens are not there, MNIRE uses the contexts to predict the tokens due to the high co-occurrence likelihoods. Our unique idea is to treat the name generation as an abstract summarization on the tokens collected from the names of the program entities in the three above contexts.

We conducted several experiments to evaluate MNIRE in method name consistency checking and in method name recommending on large datasets with +14M methods. In detecting inconsistency method names, MNIRE improves the state-of-the-art approach by 10.4% and 11% relatively in recall and precision, respectively. In method name recommendation, MNIRE improves relatively over the state-of-the-art technique, code2vec, in both recall (18.2% higher) and precision (11.1% higher). To assess MNIRE’s usefulness, we used it to detect inconsistent methods and suggest new names in several active, GitHub projects. We made 50 pull requests and received 42 responses. Among them, 5 PRs were merged into the main branch, and 13 were approved for later merging. In total, in 31/42 cases, the developer teams agree that our suggested names are more meaningful than the current names, showing MNIRE’s usefulness.

Tue 7 Jul
Times are displayed in time zone: (UTC) Coordinated Universal Time change

15:00 - 16:00: A3-Code SummarizationPaper Presentations / Technical Papers / New Ideas and Emerging Results at Silla
Chair(s): Shaohua WangNew Jersey Institute of Technology, USA
15:00 - 15:12
Talk
Technical Papers
Profir-Petru PârțachiUniversity College London, Santanu Kumar DashUniversity College London, UK, Christoph TreudeThe University of Adelaide, Earl T. BarrUniversity College London, UK
Pre-print Media Attached File Attached
15:12 - 15:24
Talk
Technical Papers
Juan ZhaiRutgers University, Xiangzhe XuNanjing University, Yu ShiPurdue University, Guanhong TaoPurdue University, Minxue PanNanjing University, Shiqing MaRutgers University, Lei XuNational Key Laboratory for Novel Software Technology, Nanjing University, Weifeng ZhangNanjing University of Posts and Telecommunications, Lin TanPurdue University, Xiangyu ZhangPurdue University
15:24 - 15:36
Talk
Technical Papers
Son NguyenThe University of Texas at Dallas, Hung Phan, Trinh LeUniversity of Engineering and Technology, Tien N. NguyenUniversity of Texas at Dallas
Pre-print
15:36 - 15:42
Talk
New Ideas and Emerging Results
Annie LouisUniversity of Edinburgh, Santanu Kumar DashUniversity College London, UK, Earl T. BarrUniversity College London, UK, Michael D. ErnstUniversity of Washington, USA, Charles SuttonGoogle Research
15:42 - 15:54
Talk
Technical Papers
Jian ZhangBeihang University, Xu WangBeihang University, Hongyu ZhangUniversity of Newcastle, Australia, Hailong SunBeihang University, Xudong LiuBeihang University
Pre-print
15:54 - 16:00
Talk
New Ideas and Emerging Results
Casey CasalnuovoUniversity of California at Davis, USA, Earl T. BarrUniversity College London, UK, Santanu Kumar DashUniversity College London, UK, Prem DevanbuUniversity of California, Emily MorganUniversity of California, Davis