Code recommendation for exception handling
Tam Nguyen, Phong Vu, Tung Nguyen
Abstract
Exception handling is an effective mechanism to avoid unexpected runtime errors. However, novice programmers might fail to handle exceptions properly, causing serious errors like system crashing or resource leaking. In this paper, we introduce FuzzyCatch, a code recommendation tool for handling exceptions. Based on fuzzy logic, FuzzyCatch can predict if a runtime exception would occur in a given code snippet and recommend code to handle that exception. FuzzyCatch is implemented as a plugin for Android Studio. The empirical evaluation suggests that FuzzyCatch is highly effective. For example, it has top-1 accuracy of 77% on recommending what exception to catch in a try catch block and of 70% on recommending what method should be called when such an exception occurs. FuzzyCatch also achieves a high level of accuracy and outperforms baselines significantly on detecting and fixing real exception bugs.
Ask about this paper
Ask your agent about it.
Lune has read the top-tier papers around this one, so every answer names the papers it rests on.
Cited by top-tier papers3
- Demystifying "bad" error messages in data science librariesYida Tao, Zhihui Chen, Yepang Liu, Jifeng Xuan et al.FSE 2021 · 6 citations
- Which Exception Shall We Throw?Hao ZhongASE 2022 · 5 citations
- BERT-Based Code Learning for Exception Localization and Type PredictionChongyu Zhang, Qiping Tao, Liangyu Chen, Min ZhangAAAI 2025 · 1 citation
Related papers
- Learning to Handle ExceptionsJian Zhang, Xu Wang, Hongyu Zhang, Hailong Sun et al.ASE 2020 · 19 citations
- Programming Assistant for Exception Handling with CodeBERTYuchen Cai, Aashish Yadavally, Abhishek Mishra, Genesis Montejo et al.ICSE 2024 · 4 citations
- From Misuse to Mastery: Enhancing Code Generation with Knowledge-Driven AI ChainingXiaoxue Ren, Xinyuan Ye, Dehai Zhao, Zhenchang Xing et al.ASE 2023 · 28 citations
- A Stitch in Time: Supporting Android Developers in WritingSecure CodeDuc Cuong Nguyen, Dominik Wermke, Yasemin Acar, Michael Backes et al.CCS 2017 · 125 citations
- Detecting Exception Handling Bugs in C++ ProgramsHao Zhang, Ji Luo, Mengze Hu, Jun Yan et al.ICSE 2023 · 7 citations
