paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Programming Assistant for Exception Handling with CodeBERT

基于 CodeBERT 的异常处理编程助手
ICSE Proceedings of the IEEE/ACM 46th International Conference on Software Engineering2024匹配度 3/10 · 该论文属于机器学习辅助编程/代码推荐,任务是为 Java 片段推荐异常处理,但与用户核心方向(ML系统或 Agentic 程序的静态分析、LLM 辅助静态分析/形式化验证、浮点程序分析、贝叶斯程序分析)关系较弱;且使用较旧的 CodeBERT 多任务微调,而非当前较强模型或 Agent 工具链,也未体现静态分析理论或工业落地深度。引用 5 inbox
Yuchen Cai, Aashish Yadavally, Abhishek Mishra, Genesis Montejo, Tien Nguyen
crossref: 2026-09-12

AI 速览

一句话:提出 Neurex,基于 CodeBERT 多任务微调,为 Java 片段推荐是否需 try-catch、try 块语句与捕获异常类型。

开发者论坛的代码片段常缺少异常处理细节,而适配代码库时需记住哪些 API 会抛异常、应处理哪些异常。本文提出 Neurex,一个从完整代码学习的异常处理推荐器:给定 Java 代码片段,推荐是否需 try-catch、哪些语句应放入 try 块,以及 catch 应捕获哪些异常类型。受 NLP 序列分块启发,作者用多任务模型微调 CodeBERT 联合完成三项任务。该模型可学习周围上下文,更好捕捉 API 元素间依赖及语句与异常类型的关系。摘要未报告具体实验指标。

问题
论坛代码片段常缺少异常处理细节,开发者难以判断哪些 API 会抛异常及应处理哪些异常,因此需要自动推荐异常处理。
方法
提出 Neurex,将问题建模为三项推荐任务,通过多任务微调 CodeBERT,利用上下文学习 API 依赖及语句与异常类型关系。
评估
摘要未给出具体数据集、指标与实验结果;评估围绕三项异常处理推荐任务展开。
原文摘要(Abstract)

With practical code reuse, the code fragments from developers' forums often migrate to applications. Owing to the incomplete nature of such fragments, they often lack the details on exception handling. The adaptation for exception handling to the codebase is not trivial as developers must learn and memorize what API methods could cause exceptions and what exceptions need to be handled. We propose Neurex, an exception handling recommender that learns from complete code, and accepts a given Java code snippet and recommends 1) if a try-catch block is needed, 2) what statements need to be placed in a try block, and 3) what exception types need to be caught in the catch clause. Inspired by the sequence chunking techniques in natural language processing, we design Neurex via a multi-tasking model with the fine-tuning of the large language model CodeBERT for these three exception handling recommendation tasks. Via the large language model, Neurex can learn the surrounding context, leading to better learning the dependencies among the API elements, and the relations between the statements and the corresponding exception types needed to be handled.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot11426,
  title = {Programming Assistant for Exception Handling with CodeBERT},
  author = {Yuchen Cai and Aashish Yadavally and Abhishek Mishra and Genesis Montejo and Tien Nguyen},
  booktitle = {ICSE},
  year = {2024},
  doi = {10.1145/3597503.3639188}
}