Proceedings

Capturing the Long-Distance Dependency in the Control Flow Graph via Structural-Guided Attention for Bug Localization

Download BibTeX Cite

Proceedings of the Thirty-Second International Joint Conference on Artificial Intelligence. Main Track. Pages 2242-2250.

https://doi.org/10.24963/ijcai.2023/249

Abstract

To alleviate the burden of software maintenance, bug localization, which aims to automatically locate the buggy source files based on the bug report, has drawn significant attention in the software mining community. Recent studies indicate that the program structure in source code carries more semantics reflecting the program behavior, which is beneficial for bug localization. Benefiting from the rich structural information in the Control Flow Graph (CFG), CFG-based bug localization methods have achieved the state-of-the-art performance. Existing CFG-based methods extract the semantic feature from the CFG via the graph neural network. However, the step-wise feature propagation in the graph neural network suffers from the problem of information loss when the propagation distance is long, while the long-distance dependency is rather common in the CFG. In this paper, we argue that the long-distance dependency is crucial for feature extraction from the CFG, and propose a novel bug localization model named sgAttention. In sgAttention, a particularly designed structural-guided attention is employed to globally capture the information in the CFG, where features of irrelevant nodes are masked for each node to facilitate better feature extraction from the CFG. Experimental results on four widely-used open-source software projects indicate that sgAttention averagely improves the state-of-the-art bug localization methods by 32.9\% and 29.2\% and the state-of-the-art pre-trained models by 5.8\% and 4.9\% in terms of MAP and MRR, respectively.

  1. [Chen et al., 2022] An Ran Chen, Tse-Hsun Chen, and Shaowei Wang. Pathidea: Improving information retrieval-based bug localization by re-constructing execu- tion paths using logs. IEEE Transactions on Software En- gineering, 48(8):2905-2919, 2022.
  2. [Ciborowska and Damevski, 2022] Agnieszka Ciborowska and Kostadin Damevski. Fast changeset-based bug localization with BERT. In 44th IEEE/ACM International Conference on Software Engineering, Pittsburgh, PA, USA, pages 946-957. ACM, 2022.
  3. [Devlin et al., 2019] Jacob Devlin, Ming-Wei Chang, Ken- ton Lee, and Kristina Toutanova. BERT: pre-training of deep bidirectional transformers for language understand- ing. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Minneapo- lis, MN, USA, pages 4171-4186. Association for Compu- tational Linguistics, 2019.
  4. [Fejzer et al., 2022] Mikolaj Fejzer, Jakub Narebski, Piotr Przymus, and Krzysztof Stencel. Tracking buggy files: New efficient adaptive bug localization algorithm. IEEE Transactions on Software Engineering, 48(7):2557-2569, 2022.
  5. [Feng et al., 2020] Zhangyin Feng, Daya Guo, Duyu Tang, Nan Duan, Xiaocheng Feng, Ming Gong, Linjun Shou, Bing Qin, Ting Liu, Daxin Jiang, and Ming Zhou. Code- BERT: A pre-trained model for programming and natural languages. In Findings of the Association for Computa- tional Linguistics: EMNLP, Online Event, pages 1536- 1547. Association for Computational Linguistics, 2020.
  6. [Fischer et al., 2003] Michael Fischer, Martin Pinzger, and Harald Gall. Populating a release history database from version control and bug tracking systems. In International Conference on Software Maintenance, pages 23-32, 2003.
  7. [Gay et al., 2009] Gregory Gay, Sonia Haiduc, Andrian Marcus, and Tim Menzies. On the use of relevance feedback in ir-based concept location. In IEEE Interna- tional Conference on Software Maintenance, pages 351- 360, 2009.
  8. [Guo et al., 2021] Daya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng, Duyu Tang, Shujie Liu, Long Zhou, Nan Duan, Alexey Svyatkovskiy, Shengyu Fu, Michele Tufano, Shao Kun Deng, Colin B. Clement, Dawn Drain, Neel Sundaresan, Jian Yin, Daxin Jiang, and Ming Zhou. GraphCodeBERT: Pre-training code representations with data flow. In 9th International Conference on Learning Representations, Virtual Event. OpenReview.net, 2021.
  9. [Gupta et al., 2019] Rahul Gupta, Aditya Kanade, and Shirish K. Shevade. Neural attribution for semantic bug- localization in student programs. In Advances in Neu- ral Information Processing Systems 32, Vancouver, BC, Canada, pages 11861-11871, 2019.
  10. [Hellendoorn et al., 2020] Vincent J. Hellendoorn, Charles Sutton, Rishabh Singh, Petros Maniatis, and David Bieber. Global relational models of source code. In 8th Inter- national Conference on Learning Representations, Addis Ababa, Ethiopia. OpenReview.net, 2020.
  11. [Huo and Li, 2017] Xuan Huo and Ming Li. Enhancing the unified features to locate buggy files by exploiting the se- quential nature of source code. In Proceedings of the 26th International Joint Conference on Artificial Intelligence, pages 1909-1915, Melbourne, Australia, 2017. IJCAI
  12. [Huo et al., 2016] Xuan Huo, Ming Li, and Zhi-Hua Zhou. Learning unified features from natural and programming languages for locating buggy source code. In Proceedings of the 25th International Joint Conference on Artificial In- telligence, pages 1606-1612, New York, USA, 2016. IJCAI
  13. [Huo et al., 2019] Xuan Huo, Ferdian Thung, Ming Li, David Lo, and Shu-Ting Shi. Deep transfer bug local- ization. IEEE Transactions on Software Engineering, 47(7):1368-1380, 2019.
  14. [Huo et al., 2020] Xuan Huo, Ming Li, and Zhi-Hua Zhou. Control flow graph embedding based on multi-instance decomposition for bug localization. In Proceedings of the 34th AAAI Conference on Artificial Intelligence, vol- ume 34, pages 4223-4230, New York, USA, 2020.
  15. [Jarman et al., 2022] Darryl Jarman, Jeffrey Berry, Riley Smith, Ferdian Thung, and David Lo. Legion: Massively composing rankers for improved bug localization at adobe. IEEE Transactions on Software Engineering, 48(8):3010- 3024, 2022.
  16. [Kochhar et al., 2014] Pavneet Singh Kochhar, Yuan Tian, and David Lo. Potential biases in bug localization: Do they matter? In Proceedings of the 29th ACM/IEEE Inter- national Conference on Automated Software Engineering, page 803-814, Vasteras, Sweden, 2014.
  17. [Lam et al., 2015] An N. Lam, Anh T. Nguyen, Hoan A. Nguyen, and Tien N. Nguyen. Combining deep learning with information retrieval to localize buggy files for bug reports (n). In 30th IEEE/ACM International Conference on Automated Software Engineering, Lincoln, NE, USA, pages 476-481, 2015.
  18. [Lam et al., 2017] An N. Lam, Anh T. Nguyen, Hoan A. Nguyen, and Tien N. Nguyen. Bug localization with com- bination of deep learning and information retrieval. In Pro- ceedings of the 25th International Conference on Program Comprehension, Buenos Aires, Argentina, pages 218-229. IEEE Computer Society, 2017.
  19. [Liang et al., 2022] Hongliang Liang, Dengji Hang, and Xi- angyu Li. Modeling function-level interactions for file- level bug localization. Empirical Software Engineering, 27(7):186, 2022.
  20. [Loshchilov and Hutter, 2019] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In 7th In- ternational Conference on Learning Representations, New Orleans, LA, USA. OpenReview.net, 2019.
  21. [Lukins et al., 2008] Stacy K. Lukins, Nicholas A. Kraft, and Letha H. Etzkorn. Source code retrieval for bug lo- calization using latent dirichlet allocation. In Proceedings of the 15th Working Conference on Reverse Engineering, Antwerp, Belgium, pages 155-164. IEEE Computer Soci- ety, 2008.
  22. [Ma and Li, 2022] Yi-Fan Ma and Ming Li. The flowing na- ture matters: feature learning from the control flow graph of source code for bug localization. Machine Learning, 111(3):853-870, 2022.
  23. [Peng et al., 2021] Han Peng, Ge Li, Wenhan Wang, Yunfei Zhao, and Zhi Jin. Integrating tree path in transformer for code representation. In Advances in Neural Information Processing Systems 34: Annual Conference on Neural In- formation Processing Systems 2021, virtual, pages 9343- 9354, 2021.
  24. [Poshyvanyk et al., 2007] Denys Poshyvanyk, Yann-Gael Gueheneuc, Andrian Marcus, Giuliano Antoniol, and Va- clav Rajlich. Feature location using probabilistic ranking of methods based on execution scenarios and information retrieval. IEEE Transactions on Software Engineering, 33(6):420-432, 2007.
  25. [Rahman and Roy, 2018] Mohammad M. Rahman and Chanchal K. Roy. Improving ir-based bug localization with context-aware query reformulation. In Proceedings of the 26th ACM Joint Meeting on European Software En- gineering Conference and Symposium on the Foundations of Software Engineering, page 621-632, New York, NY, USA, 2018.
  26. [Saha et al., 2013] Ripon K. Saha, Matthew Lease, Sarfraz Khurshid, and Dewayne E. Perry. Improving bug local- ization using structured information retrieval. In 28th IEEE/ACM International Conference on Automated Soft- ware Engineering, Silicon Valley, CA, USA, pages 345- 355. IEEE, 2013.
  27. [Vaswani et al., 2017] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Proceedings of the 31st International Con- ference on Neural Information Processing Systems, page 6000-6010, Red Hook, NY, USA, 2017.
  28. [Wang et al., 2018] Yaojing Wang, Yuan Yao, Hanghang Tong, Xuan Huo, Ming Li, Feng Xu, and Jian Lu. Bug lo- calization via supervised topic modeling. In 18th IEEE In- ternational Conference on Data Mining, Singapore, pages 607-616. IEEE Computer Society, 2018.
  29. [Wen et al., 2016] Ming Wen, Rongxin Wu, and Shing-Chi Cheung. Locus: locating bugs from software changes. In Proceedings of the 31st IEEE/ACM International Con- ference on Automated Software Engineering, Singapore, pages 262-273. ACM, 2016.
  30. [Wong et al., 2014] Chu-Pan Wong, Yingfei Xiong, Hongyu Zhang, Dan Hao, Lu Zhang, and Hong Mei. Boosting bug-report-oriented fault localization with segmentation and stack-trace analysis. In 30th IEEE International Con- ference on Software Maintenance and Evolution, Victo- ria, BC, Canada, pages 181-190. IEEE Computer Society, 2014.
  31. [Yang et al., 2021] Shouliang Yang, Junming Cao, Hushuang Zeng, Beijun Shen, and Hao Zhong. Lo- cating faulty methods with a mixed RNN and attention model. In 29th IEEE/ACM International Conference on Program Comprehension, Madrid, Spain, pages 207-218. IEEE, 2021.
  32. [Ye et al., 2014] Xin Ye, Razvan Bunescu, and Chang Liu. Learning to rank relevant files for bug reports using do- main knowledge. In Proceedings of the 22nd ACM SIG- SOFT International Symposium on Foundations of Soft- ware Engineering, Hong Kong, China, pages 689-699. ACM, 2014.
  33. [Ye et al., 2016] Xin Ye, Razvan C. Bunescu, and Chang Liu. Mapping bug reports to relevant files: A ranking model, a fine-grained benchmark, and feature evaluation. IEEE Transactions on Software Engineering, 42(4):379- 402, 2016.
  34. [Ying et al., 2021] Chengxuan Ying, Tianle Cai, Shengjie Luo, Shuxin Zheng, Guolin Ke, Di He, Yanming Shen, and Tie-Yan Liu. Do transformers really perform badly for graph representation? In Advances in Neural Informa- tion Processing Systems 34, Virtual, pages 28877-28888, 2021.
  35. [Youm et al., 2017] Klaus Changsun Youm, June Ahn, and Eunseok Lee. Improved bug localization based on code change histories and bug reports. Information and Soft- ware Technology, 82:177 -192, 2017.
  36. [Zhang et al., 2019] Wen Zhang, Ziqiang Li, Qing Wang, and Juan Li. Finelocator: A novel approach to method- level fine-grained bug localization by query expansion. In- formation Software Technology, 110:121-135, 2019.
  37. [Zhang et al., 2020] Jing-Lei Zhang, Rui Xie, Wei Ye, Yu- Han Zhang, and Shi-Kun Zhang. Exploiting code knowl- edge graph for bug localization via bi-directional attention. In Proceedings of the 28th International Conference on Program Comprehension, page 219-229, New York, NY, USA, 2020.
  38. [Zhou et al., 2012] Jian Zhou, Hong-Yu Zhang, and David Lo. Where should the bugs be fixed? more accurate infor- mation retrieval-based bug localization based on bug re- ports. In 34th International Conference on Software Engi- neering, pages 14-24. IEEE Computer Society, 2012.
  39. [Zhu et al., 2020] Ziye Zhu, Yun Li, Hanghang Tong, and Yu Wang. COOBA: Cross-project bug localization via ad- versarial transfer learning. In Proceedings of the Twenty- Ninth International Joint Conference on Artificial Intelli- gence, pages 3565-3571, 2020. IJCAI
  40. [Zhu et al., 2022] Ming Zhu, Karthik Suresh, and Chan- dan K. Reddy. Multilingual code snippets training for pro- gram translation. In Proceedings of the Thirty-Sixth AAAI Conference on Artificial Intelligence, Virtual Event, pages 11783-11790. AAAI Press, 2022.

References were extracted automatically from the PDF and may contain errors.

Welcome Future Conferences AI Journal Division IJCAI Proceedings About IJCAI IJCAI Awards