作者
Mary Beth Kery, Claire Le Goues, Brad A Myers
发表日期
2016/5/14
图书
Proceedings of the 13th International Conference on Mining Software Repositories
页码范围
484-487
简介
Many have argued that the current try/catch mechanism for handling exceptions in Java is flawed. A major complaint is that programmers often write minimal and low quality handlers. We used the Boa tool to examine a large number of Java projects on GitHub to provide empirical evidence about how programmers currently deal with exceptions. We found that programmers handle exceptions locally in catch blocks much of the time, rather than propagating by throwing an Exception. Programmers make heavy use of actions like Log, Print, Return, or Throw in catch blocks, and also frequently copy code between handlers. We found bad practices like empty catch blocks or catching Exception are indeed widespread. We discuss evidence that programmers may misjudge risk when catching Exception, and face a tension between handlers that directly address local program statement failure and handlers that consider …
引用总数
201720182019202020212022202320241010755134
学术搜索中的文章
MB Kery, C Le Goues, BA Myers - Proceedings of the 13th International Conference on …, 2016