Neural Exception Handling Recommender
Document Type
Conference Proceeding
Publication Date
4-14-2024
Abstract
Practical code reuse often leads to the incorporation of code fragments from developer forums into applications. However, these fragments, being incomplete, frequently lack details on exception handling. Integrating exception handling into a codebase is not a straightforward task, requiring developers to understand and remember which API methods may trigger exceptions and which exceptions should be handled. To address that, we introduce EHBlock, a learning-based exception handling recommender for Java code snippets. EHBlock analyzes a given code snippet and suggests whether a try-catch block is necessary. It employs a Relational Graph Convolutional Network (R-GCN) to learn exception handling from complete code. R-GCN considers program dependencies in the surrounding context, allowing EHBlock to learn the identities of APIs and their relations with corresponding exception types that need to be handled. Our empirical evaluation shows that EHBlock achieves a 12.3% improvement in F-score compared to the state-of-the-art approach in determining the need of try-catch blocks.
Identifier
85194814002 (Scopus)
ISBN
[9798400705021]
Publication Title
Proceedings - International Conference on Software Engineering
External Full Text Location
https://doi.org/10.1145/3639478.3643082
ISSN
02705257
First Page
316
Last Page
317
Grant
CNS-2120386
Fund Ref
National Science Foundation
Recommended Citation
Li, Yi; Nguyen, Tien N.; Cai, Yuchen; Yadavally, Aashish; Mishra, Abhishek; and Montejo, Genesis, "Neural Exception Handling Recommender" (2024). Faculty Publications. 502.
https://digitalcommons.njit.edu/fac_pubs/502