- Title
- Learning to handle exceptions
- Creator
- Zhang, Jian; Wang, Xu; Zhang, Hongyu; Sun, Hailong; Pu, Yanjun; Liu, Xudong
- Relation
- 35th IEEE/ACM International Conference on Automated Software Engineering (ASE 2020). ASE '20: Proceedings of the 35th IEEE/ACM International Conference on Automated Software Engineering (Virtual Event, Australia 21-25 September, 2020) p. 29-41
- Relation
- ARC.DP200102940 http://purl.org/au-research/grants/arc/DP200102940
- Publisher Link
- http://dx.doi.org/10.1145/3324884.3416568
- Publisher
- Association for Computing Machinery (ACM)
- Resource Type
- conference paper
- Date
- 2020
- Description
- 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.
- Subject
- exception handling; deep learning; neural network; code generation
- Identifier
- http://hdl.handle.net/1959.13/1438979
- Identifier
- uon:40785
- Identifier
- ISBN:9781450367684
- Language
- eng
- Reviewed
- Hits: 2333
- Visitors: 2333
- Downloads: 0