paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Automated refactoring of nested-IF formulae in spreadsheets

电子表格中嵌套 IF 公式的自动重构
FSE Proceedings of the 2018 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering2018匹配度 3/10 · 论文属于程序分析与自动化重构,基于 AST 去除冗余并重组内置函数,与静态分析/PL 工具有间接关联;但不涉及 ML/Agentic 程序、LLM 辅助分析、浮点程序分析或贝叶斯程序分析,与用户核心方向距离较远。引用 12 inbox
Jie Zhang, Shi Han, Dan Hao, Lu Zhang, Dongmei Zhang
crossref: 2026-09-12

AI 速览

一句话:首次大规模揭示电子表格嵌套 IF 公式的普遍性,并提出基于 AST 去冗余与内置函数重组的自动重构方法。

电子表格是流行的最终用户编程环境,公式中广泛使用的嵌套 IF 表达式可读性差、认知成本高,且在复用和维护中易出错。由于最终用户通常缺乏编程语言知识,难以发现或解决该问题,此前也没有自动方法。本文首次基于两个包含逾 8 万份工业级电子表格的语料库调查嵌套 IF 使用情况,发现其出乎意料地普遍。随后提出自动重构方法:先根据公式 AST 检测并删除逻辑冗余,再识别由碎片化、分散语法表示的高层语义,并用简洁内置函数重组语法。对超过 2800 万个嵌套 IF 公式的评估表明,该方法能缓解 90% 以上公式的坏味。

问题
电子表格公式中的嵌套 IF 表达式可读性差、认知成本高,复用和维护时易出错;最终用户通常缺乏编程语言知识,且此前没有自动方法。
方法
本文先基于公式 AST 检测并删除逻辑冗余,再识别由碎片化语法表示的高层语义,并用简洁内置函数重组语法,从而自动重构嵌套 IF 公式。
评估
作者在两个含逾 8 万份工业级电子表格的语料库上调查使用情况,并在超过 2800 万个嵌套 IF 公式上评估,结果显示可缓解 90% 以上公式的坏味。
原文摘要(Abstract)

Spreadsheets are the most popular end-user programming software, where formulae act like programs and also have smells. One well recognized smell is the use of nested-IF expressions, which have low readability and high cognitive cost for users, and are error-prone during reuse or maintenance. End users usually lack essential programming language knowledge to tackle or even realize this problem, yet no automatic approaches are currently available. This paper proposes the first exploration of the nest-if usage status against two large-scale spreadsheet corpora containing over 80,000 industry-level spreadsheets. It turns out the use of nested-IF expressions are surprisingly common among end users. We then present an approach to tackling this problem through automatic formula refactoring. The general idea of the automatic approach is two-fold. First, we detect and remove logic redundancy based on the AST of a formula. Second, we identify higher-level semantics that have been represented with fragmented and scattered syntax, and reassemble the syntax using concise built-in functions. A comprehensive evaluation with over 28 million nested-IF formulae reveals that the approach is able to relieve the smell of over 90% of nested-IF formulae.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot4645,
  title = {Automated refactoring of nested-IF formulae in spreadsheets},
  author = {Jie Zhang and Shi Han and Dan Hao and Lu Zhang and Dongmei Zhang},
  booktitle = {FSE},
  year = {2018},
  doi = {10.1145/3236024.3275532}
}