With practical code reuse, the code fragments from developer forums often migrate to applications. Owing to the incomplete nature of such fragments, they often lack the details on exception handling. The adaptation for exception handling to the codebase is not trivial as developers must learn and memorize what API methods could cause exceptions and what exceptions need to be handled. We propose Neurex, an exception-handling recommender that learns from complete code, and accepts a given Java code snippet and recommends 1) if a try-catch block is needed, 2) what statements need to be placed in a try block, and 3) what exception types need to be caught in the catch clause. Inspired by the sequence chunking techniques in natural language processing, we design Neurex via a multi-tasking model with the fine-tuning of the large language model CodeBERT for the three above exception handling recommending tasks. Via the large language model, we enable Neurex to learn the surrounding context, leading to better learning the dependencies among APIs, and the relations between the statements and the corresponding exception types needed to be handled.
Our empirical evaluation shows that Neurex correctly performs all three exception-handling recommendation tasks in 71.5% of the cases with an F1-score of 70.2%. It improves relatively 166% over the baseline. It achieves high F1-score from 98.2%–99.7% in try-catch block necessity checking (a relative improvement of up to 55.9% over the baselines). It also correctly decides both the need for try-catch block(s) and the statements to be placed in try blocks with the F1-scores of 74.7% and 87.1% at the instance and statement levels, an improvement of 129.1% and 44.9% over the baseline, respectively. Our extrinsic evaluation shows that Neurex relatively improves over the baseline by 56.5% in F1-score in detecting exception-related bugs in incomplete Android code snippets.
Thu 18 AprDisplayed time zone: Lisbon change
14:00 - 15:30 | LLM, NN and other AI technologies 4Research Track / Industry Challenge Track / New Ideas and Emerging Results at Pequeno Auditório Chair(s): David Nader Palacio William & Mary | ||
14:00 15mTalk | Programming Assistant for Exception Handling with CodeBERT Research Track Yuchen Cai University of Texas at Dallas, Aashish Yadavally University of Texas at Dallas, Abhishek Mishra University of Texas at Dallas, Genesis Montejo University of Texas at Dallas, Tien N. Nguyen University of Texas at Dallas | ||
14:15 15mTalk | An Empirical Study on Noisy Label Learning for Program Understanding Research Track Wenhan Wang Nanyang Technological University, Yanzhou Li Nanyang Technological University, Anran Li Nanyang Technological University, Jian Zhang Nanyang Technological University, Wei Ma Nanyang Technological University, Singapore, Yang Liu Nanyang Technological University Pre-print | ||
14:30 15mTalk | An Empirical Study on Low GPU Utilization of Deep Learning Jobs Research Track Yanjie Gao Microsoft Research, yichen he , Xinze Li Microsoft Research, Bo Zhao Microsoft Research, Haoxiang Lin Microsoft Research, Yoyo Liang Microsoft, Jing Zhong Microsoft, Hongyu Zhang Chongqing University, Jingzhou Wang Microsoft Research, Yonghua Zeng Microsoft, Keli Gui Microsoft, Jie Tong Microsoft, Mao Yang Microsoft Research DOI Pre-print | ||
14:45 15mTalk | Using an LLM to Help With Code Understanding Research Track Daye Nam Carnegie Mellon University, Andrew Macvean Google, Inc., Vincent J. Hellendoorn Carnegie Mellon University, Bogdan Vasilescu Carnegie Mellon University, Brad A. Myers Carnegie Mellon University | ||
15:00 15mTalk | MissConf: LLM-Enhanced Reproduction of Configuration-Triggered Bugs Industry Challenge Track Ying Fu National University of Defense Technology, Teng Wang National University of Defense Technology, Shanshan Li National University of Defense Technology, Jinyan Ding National University of Defense Technolog, Shulin Zhou National University of Defense Technology, Zhouyang Jia National University of Defense Technology, Wang Li National University of Defense Technology, Yu Jiang Tsinghua University, Liao Xiangke National University of Defense Technology File Attached | ||
15:15 7mTalk | XAIport: A Service Framework for the Early Adoption of XAI in AI Model Development New Ideas and Emerging Results Zerui Wang Concordia University, Yan Liu Concordia University, Abishek Arumugam Thiruselvi Concordia University, Wahab Hamou-Lhadj Concordia University, Montreal, Canada DOI Pre-print | ||
15:22 7mTalk | Which Syntactic Capabilities Are Statistically Learned by Masked Language Models for Code? New Ideas and Emerging Results Alejandro Velasco William & Mary, David Nader Palacio William & Mary, Daniel Rodriguez-Cardenas , Denys Poshyvanyk William & Mary Pre-print |