paperbot · PL 论文追踪

全部论文 待读 收藏

P2 A framework for writing trigger-action todo comments in executable format

一个以可执行格式编写触发器-动作 TODO 注释的框架
FSE Proceedings of the 2019 27th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering2019匹配度 2/10 · 论文属于软件工程/开发者工具领域,核心是将 trigger-action TODO 注释写成可执行规约并利用 AST 查询在构建时自动执行。它不涉及 LLM/Agentic 程序、静态分析在 ML/Agent 系统中的应用、浮点程序分析或贝叶斯程序分析,与用户研究画像的核心交叉方向几乎没有交集。引用 20 inbox
Pengyu Nie, Rishabh Rai, Junyi Jessy Li, Sarfraz Khurshid, Raymond J. Mooney, Milos Gligoric
crossref: 2026-09-12

AI 速览

一句话:提出 TrigIt,将 trigger-action TODO 注释写成可执行规约,在构建时自动执行查询、通知与代码变换。

自然语言 TODO 注释常用来描述在特定条件(触发器)满足时需执行的任务(动作),但因非形式化,随着项目演化容易过时或被遗忘。本文提出首个将 trigger-action TODO 注释可执行化的框架 TrigIt:规约用宿主语言(如 Java)编写,并作为构建过程的一部分求值。触发器是对抽象语法树、构建配置脚本、issue 跟踪系统和系统时钟的查询;动作可以是通知开发者或代码变换。作者在 Java 上实现 TrigIt,并从多个流行开源项目迁移了 44 条 trigger-action 注释。用户研究表明用户认为 TrigIt 易学易用,有望促进大型代码仓库中注释的编写与维护纪律。

问题
自然语言 trigger-action TODO 注释因缺乏形式化语义,在项目演化、流程变更和团队重组后常变得无关或被遗忘。
方法
提出 TrigIt 框架,用宿主语言以可执行格式指定 trigger-action 注释,触发器为对 AST、构建配置、issue 跟踪系统和时钟的查询,动作触发后自动执行通知或代码变换,并集成到构建过程。
评估
在 Java 上实现 TrigIt,从多个流行开源项目迁移 44 条现有 trigger-action 注释,并通过用户研究评估其易学性与易用性。
原文摘要(Abstract)

Natural language elements, e.g., todo comments, are frequently used to communicate among developers and to describe tasks that need to be performed (actions) when specific conditions hold on artifacts related to the code repository (triggers), e.g., from the Apache Struts project: “remove expectedJDK15 and if() after switching to Java 1.6”. As projects evolve, development processes change, and development teams reorganize, these comments, because of their informal nature, frequently become irrelevant or forgotten. We present the first framework, dubbed TrigIt, to specify trigger-action todo comments in executable format. Thus, actions are executed automatically when triggers evaluate to true. TrigIt specifications are written in the host language (e.g., Java) and are evaluated as part of the build process. The triggers are specified as query statements over abstract syntax trees, abstract representation of build configuration scripts, issue tracking systems, and system clock time. The actions are either notifications to developers or code transformation steps. We implemented TrigIt for the Java programming language and migrated 44 existing trigger-action comments from several popular open-source projects. Evaluation of TrigIt, via a user study, showed that users find TrigIt easy to learn and use. TrigIt has the potential to enforce more discipline in writing and maintaining comments in large code repositories.

链接与引用

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

BibTeX
@inproceedings{paperbot5044,
  title = {A framework for writing trigger-action todo comments in executable format},
  author = {Pengyu Nie and Rishabh Rai and Junyi Jessy Li and Sarfraz Khurshid and Raymond J. Mooney and Milos Gligoric},
  booktitle = {FSE},
  year = {2019},
  doi = {10.1145/3338906.3338965}
}