可执行触发器-操作注释
Executable Trigger-Action Comments
摘要:
自然语言元素,例如,todo注释经常用于在开发人员之间进行通信,并描述当代码存储库中的特定条件(触发器)成立时需要执行的任务(动作)。随着项目的发展,开发过程的改变,以及开发团队的重组,这些注释,由于其非正式的性质,经常变得无关紧要或被遗忘。我们提出了第一种技术,称为TrigIt,指定的可执行语句的注释。因此,当触发器的计算结果为true时,将自动执行操作。TrigIt规范是用主机语言编写的(例如,Java),并作为构建过程的一部分进行评估。触发器被指定为抽象语法树上的查询语句和构建配置脚本的抽象表示,而操作被指定为代码转换步骤。我们为Java程序设计语言实现了TrigIt,并从8个流行的开源项目中迁移了20个现有的编译器操作注释。我们评估使用TrigIt的可执行注释中的令牌数量和构建过程中引入的时间开销方面的成本。
英文摘要:
Natural language elements, e.g., todo comments, are frequently used to communicate among the developers and to describe tasks that need to be performed (actions) when specific conditions hold in the code repository (triggers). 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 technique, dubbed TrigIt, to specify triggeraction todo comments as executable statements. 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 and abstract representation of build configuration scripts, and the actions are specified as code transformation steps. We implemented TrigIt for the Java programming language and migrated 20 existing trigger-action comments from 8 popular open-source projects. We evaluate the cost of using TrigIt in terms of the number of tokens in the executable comments and the time overhead introduced in the build process.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。