Naming Bug Detection Using Transformer-Based Method Name Suggestion.

被引:0
作者
Minehisa T. [1 ]
Aman H. [2 ]
Kawahara M. [2 ]
机构
[1] Graduate School of Sc. and Eng., Ehime University
[2] Center for Information Technology, Ehime University
基金
日本学术振兴会;
关键词
Bug detection - Code readability - Conventional modeling - Convolutional neural network - Empirical studies - [!text type='Java']Java[!/text] methods - Machine learning models;
D O I
10.11309/jssst.39.4_17
中图分类号
学科分类号
摘要
The name of a method is an essential clue to comprehending what the method does. An inconsistency between the method’s behavior and its name—especially its first word—is referred to as a “naming bug,” leading to deterioration in the code readability. This paper proposes applying a Transformer-based machine learning model to detect naming bugs in Java methods. The proposed model can evaluate a method name’s consistency by suggesting a proper name from the method’s body. The empirical study proves the proposed model outperforms the conventional model using Doc2Vec, Word2Vec, and convolutional neural network. © 2022 Japan Society for Software Science and Technology. All rights reserved.
引用
收藏
页码:17 / 23
页数:6
相关论文
共 10 条
  • [1] Allamanis M., Barr E. T., Bird C., Sutton C., Learning Natural Coding Conventions, Proc. 22nd Int’l Symp. Foundations of Softw. Eng, pp. 281-293, (2014)
  • [2] Boswell D., Foucher T., The Art of Readable Code: Simple and Practical Techniques for Writing Better Code, (2011)
  • [3] Host E. W., Ostvold B. M., Debugging Method Names, Object-Oriented Prog, Lecture Notes in Computer Science, 5653, pp. 294-317, (2009)
  • [4] Lachaux M., Roziere B., Szafraniec M., Lample G., DOBF: A Deobfuscation Pre-Training Objective for Programming Languages, Pre-proc. Advances in Neural Inf. Procesing Syst, 34
  • [5] Liu K., Kim D., Bissyande T. F., Kim T., Kim K., Koyuncu A., Kim S., Traon Y. L., Learning to spot and refactor inconsistent method names, Proc. 41st Int’l Conf. Softw. Eng, pp. 1-12, (2019)
  • [6] Martin R. C., Clean Code: A Handbook of Agile Software Craftsmanship, (2008)
  • [7] Minehisa T., Aman H., Yokogawa T., Kawahara M., A Comparative Study of Vectorization Approaches for Detecting Inconsistent Method Names, Computer and Information Science 2021—Summer, Studies in Computational Intelligence, 985, pp. 125-144, (2021)
  • [8] Pagliardini M., Gupta P., Jaggi M., Unsupervised Learning of Sentence Embeddings Using Compositional n-Gram Features, Proc. Conf. North American Chapter of the Association for Computational Linguistics: Human Language Technologies, 1, pp. 528-540, (2018)
  • [9] Rigby P., Cleary B., Painchaud F., Storey M.A., German D., Contemporary Peer Review in Action: Lessons from Open Source Development, IEEE Softw, 29, 6, pp. 56-61, (2012)
  • [10] Vaswani A., Shazeer N., Parmar N., Uszkoreit J., Jones L., Gomez A. N., Kaiser L. u., Polosukhin I., Attention is All you Need, Advances in Neural Information Processing Systems, 30, (2017)