paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Code recommendation for exception handling

异常处理的代码推荐
FSE Proceedings of the 28th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering2020匹配度 2/10 · 该论文关注异常处理的代码推荐与运行时异常预测,属于开发者工具和软件工程方向,与用户核心关注的静态分析、Agentic/LLM 程序分析、浮点程序分析及贝叶斯程序分析几乎没有交集。其基于模糊逻辑的方法也未涉及 LLM/Agent 或形式化验证。引用 22 inbox
Tam Nguyen, Phong Vu, Tung Nguyen
crossref: 2026-09-12

AI 速览

一句话:提出基于模糊逻辑的 FuzzyCatch 工具,预测运行时异常并推荐捕获与处理方法。

异常处理是避免运行时错误的有效机制,但新手程序员常无法正确处理异常,导致系统崩溃或资源泄漏。本文提出 FuzzyCatch——一个异常处理代码推荐工具。它基于模糊逻辑,对给定代码片段预测是否会发生运行时异常,并推荐应捕获的异常类型以及异常发生后应调用的方法。FuzzyCatch 被实现为 Android Studio 插件。实证评估表明其效果显著:在 try-catch 块中推荐捕获何种异常的 top-1 准确率为 77%,推荐应调用何种方法的 top-1 准确率为 70%;在检测与修复真实异常缺陷任务上,FuzzyCatch 也取得较高准确率并显著优于基线方法。

问题
新手程序员常无法正确处理异常,导致系统崩溃或资源泄漏等严重问题,因此需要辅助开发者编写正确的异常处理代码。
方法
FuzzyCatch 基于模糊逻辑,预测给定代码片段中可能发生的运行时异常,并推荐应捕获的异常类型及应调用的处理方法,工具以 Android Studio 插件形式实现。
评估
在 try-catch 推荐任务上报告 top-1 准确率 77%(推荐捕获异常)与 70%(推荐调用方法),并在检测和修复真实异常缺陷上取得高准确率且显著优于基线。
原文摘要(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.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot5821,
  title = {Code recommendation for exception handling},
  author = {Tam Nguyen and Phong Vu and Tung Nguyen},
  booktitle = {FSE},
  year = {2020},
  doi = {10.1145/3368089.3409690}
}