paperbot · PL 论文追踪

全部论文 待读 收藏

P2 TS-Detector : Detecting Feature Toggle Usage Patterns

TS-Detector:检测特性开关使用模式
FSE Proceedings of the 33rd ACM International Conference on the Foundations of Software Engineering2025匹配度 2/10 · 该论文属于传统程序分析与软件工程中的代码模式检测,聚焦 feature toggle 使用模式,未涉及 LLM/Agent、浮点程序分析或贝叶斯程序分析,与用户核心的 PL×AI 交叉方向无直接关联。引用 0 inbox
Tajmilur Rahman, Mengzhe Fei, Tushar Sharma, Chanchal Roy
crossref: 2026-09-12

AI 速览

一句话:提出 TS-Detector 工具,从源码中检测五种 feature toggle 使用模式,并在多语言开源项目中评估。

特性开关(feature toggle)允许开发者控制功能状态,在保留整体软件功能的同时向有限用户发布功能。然而缺乏全面的最佳实践常导致不当实现,引发代码质量问题;某些开关使用模式容易产生 toggle smells,但目前没有工具能从源码检测这些使用模式。本文提出 TS-Detector,可检测五种开关使用模式:Spread、Nested、Dead、Mixed 和 Enum,并在六个编程语言的十个开源项目中应用。作者进行了人工评估,结果显示检测 Spread、Nested、Dead 的 true positive rate 分别为 80%、86.4%、66.6%,而 Mixed 与 Enum 用法的 true negative rate 达到 100%。该工具已在 GitHub 仓库发布,并提供视频演示。

问题
缺乏自动工具从源码中检测 feature toggle 使用模式,开发者难以发现可能引发 toggle smell 和代码质量问题的实现方式。
方法
提出 TS-Detector,针对五种 toggle 使用模式(Spread、Nested、Dead、Mixed、Enum)进行检测,并在十项六语言开源项目上应用。
评估
通过人工评估,报告各模式的 true positive rate 或 true negative rate:Spread 80%、Nested 86.4%、Dead 66.6%,Mixed 与 Enum 的 true negative rate 为 100%。
原文摘要(Abstract)

Feature toggles enable developers to control feature states, allowing the features to be released to a limited group of users while preserving overall software functionality. The absence of comprehensive best practices for feature toggle usage often results in improper implementation, causing code quality issues. Although certain feature toggle usage patterns are prone to toggle smells, there is no tool as of today for software engineers to detect toggle usage patterns from the source code. This paper presents a tool TS-Detector to detect five different toggle usage patterns across ten open-source software projects in six different programming languages. We conducted a manual evaluation and results show that the true positive rates of detecting Spread, Nested, and Dead toggles are 80%, 86.4%, and 66.6% respectively, and the true negative rate of Mixed and Enum usages was 100%. The tool can be downloaded from its GitHub repository 1 and can be used following the instructions provided there. The video demonstration can be viewed from the link2 shared.

链接与引用

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

BibTeX
@inproceedings{paperbot9123,
  title = {TS-Detector : Detecting Feature Toggle Usage Patterns},
  author = {Tajmilur Rahman and Mengzhe Fei and Tushar Sharma and Chanchal Roy},
  booktitle = {FSE},
  year = {2025},
  doi = {10.1145/3696630.3728591}
}