Learning to Handle Exceptions
Jian Zhang, Xu Wang, Hongyu Zhang, Hailong Sun, Yanjun Pu, Xudong Liu
摘要
Exception handling is an important built-in feature of many modern programming languages such as Java. It allows developers to deal with abnormal or unexpected conditions that may occur at runtime in advance by using try-catch blocks. Missing or improper implementation of exception handling can cause catastrophic consequences such as system crash. However, previous studies reveal that developers are unwilling or feel it hard to adopt exception handling mechanism, and tend to ignore it until a system failure forces them to do so. To help developers with exception handling, existing work produces recommendations such as code examples and exception types, which still requires developers to localize the try blocks and modify the catch block code to fit the context. In this paper, we propose a novel neural approach to automated exception handling, which can predict locations of try blocks and automatically generate the complete catch blocks. We collect a large number of Java methods from GitHub and conduct experiments to evaluate our approach. The evaluation results, including quantitative measurement and human evaluation, show that our approach is highly effective and outperforms all baselines. Our work makes one step further towards automated exception handling. CCS CONCEPTS • Software and its engineering → Error handling and recovery; Automatic programming.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper10
- CrystalBLEU: Precisely and Efficiently Measuring the Similarity of CodeAryaz Eghbali, Michael PradelASE 2022 · 被引用 33 次
- From Misuse to Mastery: Enhancing Code Generation with Knowledge-Driven AI ChainingXiaoxue Ren, Xinyuan Ye, Dehai Zhao, Zhenchang Xing 等ASE 2023 · 被引用 28 次
- Thinking Like a Developer? Comparing the Attention of Humans with Neural Models of CodeMatteo Paltenghi, Michael PradelASE 2021 · 被引用 21 次
- Detecting Condition-Related Bugs with Control Flow Graph Neural NetworkJian Zhang, Xu Wang, Hongyu Zhang, Hailong Sun 等ISSTA 2023 · 被引用 19 次
- Learning to Locate and Describe VulnerabilitiesJian Zhang, Shangqing Liu, Xu Wang, Tianlin Li 等ASE 2023 · 被引用 8 次
它引用的顶会 Paper1
相关 Paper
- Programming Assistant for Exception Handling with CodeBERTYuchen Cai, Aashish Yadavally, Abhishek Mishra, Genesis Montejo 等ICSE 2024 · 被引用 4 次
- Code recommendation for exception handlingTam Nguyen, Phong Vu, Tung NguyenFSE 2020 · 被引用 22 次
- Which Exception Shall We Throw?Hao ZhongASE 2022 · 被引用 5 次
- BERT-Based Code Learning for Exception Localization and Type PredictionChongyu Zhang, Qiping Tao, Liangyu Chen, Min ZhangAAAI 2025 · 被引用 1 次
- Where Shall We Log? Studying and Suggesting Logging Locations in Code BlocksZhenhao Li, Tse-Hsun Chen, Weiyi ShangASE 2020 · 被引用 41 次
