Executable Trigger-Action Comments

08/06/2018
by   Pengyu Nie, et al.
0

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.

READ FULL TEXT
research
12/13/2019

Associating Natural Language Comment and Source Code Entities

Comments are an integral part of software development; they are natural ...
research
03/31/2019

Exploring the Generality of a Java-based Loop Action Model for the Quorum Programming Language

Many algorithmic steps require more than one statement to implement, but...
research
08/25/2021

RepliComment: Identifying Clones in Code Comments

Code comments are the primary means to document implementation and facil...
research
08/12/2021

Automating the Removal of Obsolete TODO Comments

TODO comments are very widely used by software developers to describe th...
research
05/15/2023

A Language Model of Java Methods with Train/Test Deduplication

This tool demonstration presents a research toolkit for a language model...
research
02/27/2021

A Differential Testing Approach for Evaluating Abstract Syntax Tree Mapping Algorithms

Abstract syntax tree (AST) mapping algorithms are widely used to analyze...
research
03/17/2018

Analysing Developers Affectiveness through Markov chain Models

In this paper, we present an analysis of more than 500K comments from op...

Please sign up or login with your details

Forgot password? Click here to reset