paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Semantic relation based expansion of abbreviations

基于语义关系的缩写扩展
FSE Proceedings of the 2019 27th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering2019匹配度 2/10 · 该论文研究源代码标识符缩写扩展,属于软件工程/开发者工具方向,与静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析等核心研究方向关联较弱;仅可能作为代码理解辅助工具与PL/SE交叉,但方法论和问题均不匹配。引用 14 inbox
Yanjie Jiang, Hui Liu, Lu Zhang
crossref: 2026-09-12

AI 速览

一句话:构建语义关系知识图谱并从语料中学习搜索策略,将标识符缩写扩展的精度从 29% 提升到 85%。

标识符在源代码字符中占约 70%,其质量直接影响程序理解与软件维护,但标识符中普遍存在的缩写降低了可读性与可维护性。已有缩写扩展方法要么精度不足,要么只能处理特定类型的标识符。本文提出一种通用且准确的标识符缩写扩展方法,其核心洞察是:软件实体 e 名称中的缩写,有很大概率能在与 e 语义相关的其他实体名称中找到对应完整词。据此,方法为实体及其语义关系构建知识图谱,并在图上搜索完整词汇;图上的最优搜索策略可从人工扩展的缩写语料中自动学习得到。作者在九个知名开源项目上开展 k 折评估,结果显示该方法优于现有工作:精度从 29% 提升至 85%,召回率从 29% 提升至 77%;在参数缩写扩展上,这一通用方法甚至优于针对参数设计的专用方法,F1 分数从 75% 提升至 87%。

问题
源代码标识符中大量使用缩写,严重损害代码可读性与可维护性,而已有缩写扩展方法要么精度偏低,要么只适用于特定类型(如参数)的标识符,缺乏通用性。
方法
利用“语义相关实体的名称中往往包含缩写对应的完整词”这一洞察,为软件实体及其语义关系构建知识图谱,并在图上搜索候选完整词;最优搜索策略通过人工扩展缩写语料自动学习获得。
评估
在九个知名开源项目上进行 k 折评估,与现有最先进方法对比,精度由 29% 提升到 85%、召回率由 29% 提升到 77%,参数缩写扩展的 F1 由 75% 提升到 87%。
原文摘要(Abstract)

Identifiers account for 70% of source code in terms of characters, and thus the quality of such identifiers is critical for program comprehension and software maintenance. For various reasons, however, many identifiers contain abbreviations, which reduces the readability and maintainability of source code. To this end, a number of approaches have been proposed to expand abbreviations in identifiers. However, such approaches are either inaccurate or confined to specific identifiers. To this end, in this paper we propose a generic and accurate approach to expand identifier abbreviations. The key insight of the approach is that abbreviations in the name of software entity e have great chance to find their full terms in names of software entities that are semantically related to e. Consequently, the proposed approach builds a knowledge graph to represent such entities and their relationships with e, and searches the graph for full terms. The optimal searching strategy for the graph could be learned automatically from a corpus of manually expanded abbreviations. We evaluate the proposed approach on nine well known open-source projects. Results of our k-fold evaluation suggest that the proposed approach improves the state of the art. It improves precision significantly from 29% to 85%, and recall from 29% to 77%. Evaluation results also suggest that the proposed generic approach is even better than the state-of-the-art parameter-specific approach in expanding parameter abbreviations, improving F1 score significantly from 75% to 87%.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot5175,
  title = {Semantic relation based expansion of abbreviations},
  author = {Yanjie Jiang and Hui Liu and Lu Zhang},
  booktitle = {FSE},
  year = {2019},
  doi = {10.1145/3338906.3338929}
}