paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Context-aware code recommendation in Intellij IDEA

IntelliJ IDEA 中的上下文感知代码推荐
FSE Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering2022匹配度 2/10 · 论文是 IDE 中基于开发上下文的代码推荐插件,属于开发者工具/软件工程方向,与用户关注的 LLM/Agent 静态分析、浮点程序分析、贝叶斯程序分析等核心方向几乎没有交集。它不涉及 LLM/Agent、静态分析或形式化验证,仅可作为泛化的代码智能工具背景参考。引用 7 inbox
Shamsa Abid, Hamid Abdul Basit, Shafay Shamail
crossref: 2026-09-12

AI 速览

一句话:提出 IntelliJ IDEA 插件 CA-FACER,利用开发者当前项目上下文推荐相关代码片段,提升机会式复用准确率。

开发者常在线搜索可复用代码,但现有推荐器多基于查询,缺乏面向机会式复用的上下文感知支持。本文提出 CA-FACER,一个 IntelliJ IDEA 插件:它将开发者活跃项目中含 API 用法的方法作为开发上下文,寻找相似项目,并从其热门功能(频繁出现的基于 API 用法的 Method Clone Classes)推荐相关代码片段。在 120 个 GitHub Android Java 项目上评估,所提上下文感知方法较基线精度提升 46%;初始与演化阶段的平均精度([email protected])为 94% 和 83%,成功率 90% 和 95%。

问题
开发者进行机会式代码复用时,缺乏结合当前开发上下文的推荐支持;传统推荐器仅针对搜索查询返回结果。
方法
提出 CA-FACER IntelliJ IDEA 插件,利用活跃项目中的 API 用法方法作为上下文,匹配相似项目并推荐其高频 API 用法 Method Clone Classes 中的相关代码。
评估
在 120 个 GitHub Android Java 项目上,与基线对比精度提升 46%,并报告初始/演化阶段 [email protected] 与成功率。
原文摘要(Abstract)

Developers spend a lot of time online, searching for code to help them implement their desired features. While code recommenders help improve developers’ productivity, there is currently no support for context-aware code recommendation for opportunistic code reuse on-the-go. Typical code recommendation systems provide recommendations against a search query, whereas a code recommender that supports opportunistic reuse can recommend related code snippets that represent features that the developer may want to implement next. In this paper, we present a novel Context-aware Feature-driven API usage-based Code Recommender (CA-FACER) tool, which is an Intellij IDEA plugin that leverages a developer’s development context to recommend related code snippets. We consider the methods having API usages in a developer’s active project as part of the development context. Our approach uses contextual data from a developer’s active project to find similar projects and recommends code from popular features of those projects. The popular features are identified as frequently occurring API usage based Method Clone Classes. From our experimental evaluation on 120 Android Java projects from GitHub, we observe a 46% improvement of precision using our proposed context-aware approach over a baseline system. Our technique recommends related code examples with an average precision ([email protected]) of 94% and 83% and a success rate of 90% and 95% for initial and evolved development stages respectively. A video demonstration of our tool is available at https://youtu.be/UjuM8WRc318.

链接与引用

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

BibTeX
@inproceedings{paperbot7075,
  title = {Context-aware code recommendation in Intellij IDEA},
  author = {Shamsa Abid and Hamid Abdul Basit and Shafay Shamail},
  booktitle = {FSE},
  year = {2022},
  doi = {10.1145/3540250.3558937}
}