Learning to Handle Exceptions

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 caus...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Veröffentlicht in:2020 35th IEEE/ACM International Conference on Automated Software Engineering (ASE) S. 29 - 41
Hauptverfasser: Zhang, Jian, Wang, Xu, Zhang, Hongyu, Sun, Hailong, Pu, Yanjun, Liu, Xudong
Format: Tagungsbericht
Sprache:Englisch
Veröffentlicht: ACM 01.09.2020
Schlagworte:
ISSN:2643-1572
Online-Zugang:Volltext
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Abstract 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.
AbstractList 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.
Author Pu, Yanjun
Sun, Hailong
Wang, Xu
Zhang, Jian
Liu, Xudong
Zhang, Hongyu
Author_xml – sequence: 1
  givenname: Jian
  surname: Zhang
  fullname: Zhang, Jian
  email: zhangj@act.buaa.edu.cn
  organization: SKLSDE Lab, Beihang University,China
– sequence: 2
  givenname: Xu
  surname: Wang
  fullname: Wang, Xu
  email: wangxu@act.buaa.edu.cn
  organization: SKLSDE Lab, Beihang University,China
– sequence: 3
  givenname: Hongyu
  surname: Zhang
  fullname: Zhang, Hongyu
  email: hongyu.zhang@newcastle.edu.au
  organization: The University of Newcastle,Australia
– sequence: 4
  givenname: Hailong
  surname: Sun
  fullname: Sun, Hailong
  email: sunhl@act.buaa.edu.cn
  organization: SKLSDE Lab, Beihang University,China
– sequence: 5
  givenname: Yanjun
  surname: Pu
  fullname: Pu, Yanjun
  email: puyanjun@nlsde.buaa.edu.cn
  organization: SKLSDE Lab, Beihang University,China
– sequence: 6
  givenname: Xudong
  surname: Liu
  fullname: Liu, Xudong
  email: liuxd@act.buaa.edu.cn
  organization: SKLSDE Lab, Beihang University,China
BookMark eNotjM1Kw0AURq-iYFu7diFCXiB1Zu6dv6WU1goBN-263HRuJFInJclC396Arj4O5_DN4SZ3WQAetFppTfYZ0VAItELSzrpwBcvowyQUOu8CXcPMOMJSW2_uYD4Mn0rZCfwMnirhPrf5oxi7Ysc5naXYfJ_kMrZdHu7htuHzIMv_XcBhu9mvd2X1_vq2fqlKNuTHUpxltoyUdEQWSuFUR0SvVR0Na2GbWMQ1vtZRcaixJhOwick2YqcCF_D499uKyPHSt1_c_xyjCU4rh7_hOD37
CODEN IEEPAD
ContentType Conference Proceeding
DBID 6IE
6IL
CBEJK
RIE
RIL
DOI 10.1145/3324884.3416568
DatabaseName IEEE Electronic Library (IEL) Conference Proceedings
IEEE Xplore POP ALL
IEEE Xplore All Conference Proceedings
IEEE Xplore
IEEE Proceedings Order Plans (POP All) 1998-Present
DatabaseTitleList
Database_xml – sequence: 1
  dbid: RIE
  name: IEEE Xplore
  url: https://ieeexplore.ieee.org/
  sourceTypes: Publisher
DeliveryMethod fulltext_linktorsrc
Discipline Computer Science
EISBN 9781450367684
1450367682
EISSN 2643-1572
EndPage 41
ExternalDocumentID 9286106
Genre orig-research
GroupedDBID 29I
6IE
6IF
6IH
6IK
6IL
6IM
6IN
6J9
AAJGR
AAWTH
ABLEC
ACREN
ADYOE
ADZIZ
AFYQB
ALMA_UNASSIGNED_HOLDINGS
AMTXH
APO
BEFXN
BFFAM
BGNUA
BKEBE
BPEOZ
CBEJK
CHZPO
IEGSK
IPLJI
M43
OCL
RIE
RIL
ID FETCH-LOGICAL-a247t-e65aa5a34d193ae4d8cb933710b92a1ea5daee6f7b190a8b3b4283f9d5fe592a3
IEDL.DBID RIE
ISICitedReferencesCount 21
ISICitedReferencesURI http://www.webofscience.com/api/gateway?GWVersion=2&SrcApp=Summon&SrcAuth=ProQuest&DestLinkType=CitingArticles&DestApp=WOS_CPL&KeyUT=000651313500005&url=https%3A%2F%2Fcvtisr.summon.serialssolutions.com%2F%23%21%2Fsearch%3Fho%3Df%26include.ft.matches%3Dt%26l%3Dnull%26q%3D
IngestDate Wed Aug 27 02:33:06 EDT 2025
IsPeerReviewed false
IsScholarly true
Language English
LinkModel DirectLink
MergedId FETCHMERGED-LOGICAL-a247t-e65aa5a34d193ae4d8cb933710b92a1ea5daee6f7b190a8b3b4283f9d5fe592a3
PageCount 13
ParticipantIDs ieee_primary_9286106
PublicationCentury 2000
PublicationDate 2020-Sept.
PublicationDateYYYYMMDD 2020-09-01
PublicationDate_xml – month: 09
  year: 2020
  text: 2020-Sept.
PublicationDecade 2020
PublicationTitle 2020 35th IEEE/ACM International Conference on Automated Software Engineering (ASE)
PublicationTitleAbbrev ASE
PublicationYear 2020
Publisher ACM
Publisher_xml – name: ACM
SSID ssj0051577
ssj0002871035
Score 2.26808
Snippet 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...
SourceID ieee
SourceType Publisher
StartPage 29
SubjectTerms code generation
Deep learning
Exception handling
Java
neural network
Runtime
Semantics
Software development management
Target recognition
Task analysis
Title Learning to Handle Exceptions
URI https://ieeexplore.ieee.org/document/9286106
WOSCitedRecordID wos000651313500005&url=https%3A%2F%2Fcvtisr.summon.serialssolutions.com%2F%23%21%2Fsearch%3Fho%3Df%26include.ft.matches%3Dt%26l%3Dnull%26q%3D
hasFullText 1
inHoldings 1
isFullTextHit
isPrint
link http://cvtisr.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwlV1LTwIxEJ4A8eAJFYwvzB48Wh7b99lAOBEOmnAjfUyNFzC4GH--bVnWmHjx1jQ9dNp0vq_tzDcAD0oEqlByYiZeEhYEEksNEhGYUdYwZ0uXi03IxUKtVnrZgscmFwYRc_AZDlMz_-X7rdunp7KRLlVEe9GGtpTikKvVvKck5j-mDfWNMC1lLeUzYXxEI3FQig2j044MRv2qpZKhZNb93yTOoP-Tk1csG7Q5hxZuLqB7LMpQ1Ge0B4NaMfW1qLbFPGsoFNOvY_BKH15m0-enOalrIBBTMlkRFNwYbijzkWkZZF45qymNtlpdmgka7g2iCNJGZI-rS21SUAva84A8jqCX0NlsN3gFBXdMUae1C-kOZFALpzQbR2dNfVChvIZesnb9fpC5WNeG3vzdfQunZbp65nCrO-hUuz0O4MR9Vm8fu_u8N98vPo6c
linkProvider IEEE
linkToHtml http://cvtisr.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwlV1LTwIxEJ4gmugJFYwvdA8eLY8-tu3ZQDAi4YAJN9J2p8YLGFyMP992WdaYePHWND102nS-r-3MNwB3KvVMoRTE9DNJuE-RWGaQpJ4bZQ13lrqi2IScTNR8rqc1uK9yYRCxCD7DTmwWf_nZym3iU1lXUxXQPt2DfcE57W2ztaoXlcj9e6wivwGopSzFfPpcdFmgDkrxTnDbgcOoX9VUCjAZNv43jWNo_WTlJdMKb06ghstTaOzKMiTlKW1Cu9RMfU3yVTIqVBSSwdcufKUFL8PB7GFEyioIxFAuc4KpMEYYxrPAtQzyTDmrGQu2Wk1NH43IDGLqpQ3YHtaX2aih5nUmPIowgp1Bfbla4jkkwnHFnNbOx1uQQZ06pXkvuGuWeeXpBTSjtYv3rdDFojT08u_uWzgczZ7Hi_Hj5OkKjmi8iBbBV9dQz9cbbMOB-8zfPtY3xT59A9BjkeM
openUrl ctx_ver=Z39.88-2004&ctx_enc=info%3Aofi%2Fenc%3AUTF-8&rfr_id=info%3Asid%2Fsummon.serialssolutions.com&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=proceeding&rft.title=2020+35th+IEEE%2FACM+International+Conference+on+Automated+Software+Engineering+%28ASE%29&rft.atitle=Learning+to+Handle+Exceptions&rft.au=Zhang%2C+Jian&rft.au=Wang%2C+Xu&rft.au=Zhang%2C+Hongyu&rft.au=Sun%2C+Hailong&rft.date=2020-09-01&rft.pub=ACM&rft.eissn=2643-1572&rft.spage=29&rft.epage=41&rft_id=info:doi/10.1145%2F3324884.3416568&rft.externalDocID=9286106