10.1145/3338906.3338965acmconferencesArticle/Chapter ViewAbstractPublication PagesfseConference Proceedingsconference-collections
research-article
Public Access
Distinguished Paper

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

Online:12 August 2019Publication History

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.

References

  1. Rui Abreu, Hakan Erdogmus, and Alexandre Perez. 2015. CodeAware: Sensorbased fine-grained monitoring and management of software artifacts. In International Conference on Software Engineering, Vol. 2. 551–554. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Miltiadis Allamanis, Earl T Barr, Premkumar Devanbu, and Charles Sutton. 2018. A survey of machine learning for big code and naturalness. Comput. Surveys 51, 4 (2018), 81. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Miltos Allamanis, Daniel Tarlow, Andrew Gordon, and Yi Wei. 2015. Bimodal modelling of source code and natural language. In International Conference on Machine Learning. 2123–2132. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Oracle and/or its affiliates. 2019. Chapter 5. Loading, Linking, and Initializing. https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-5.html.Google ScholarGoogle Scholar
  5. Oracle and/or its affiliates. 2019. The Reflection API. https://docs.oracle.com/ javase/tutorial/reflect/.Google ScholarGoogle Scholar
  6. Oracle and/or its affiliates. 2019. Stream (Java Platform SE 8). https://docs.oracle. com/javase/8/docs/api/java/util/stream/Stream.html.Google ScholarGoogle Scholar
  7. Apache. 2019. Apache Struts. https://github.com/apache/struts.Google ScholarGoogle Scholar
  8. Gabriele Bavota and Barbara Russo. 2016. A large-scale empirical study on selfadmitted technical debt. In International Working Conference on Mining Software Repositories. 315–326. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Arianna Blasi, Alberto Goffi, Konstantin Kuznetsov, Alessandra Gorla, Michael D. Ernst, Mauro Pezzè, and Sergio Delgado Castellanos. 2018. Translating code comments to procedure specifications. In International Symposium on Software Testing and Analysis. 242–253. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Shobhit Chaurasia and Raymond J. Mooney. 2017. Dialog for language to code. In International Joint Conference on Natural Language Processing. 175–180.Google ScholarGoogle Scholar
  11. OW2 Consortium. 2018. ASM. http://asm.ow2.io.Google ScholarGoogle Scholar
  12. Li Dong and Mirella Lapata. 2016. Language to logical form with neural attention. In Annual Meeting of the Association for Computational Linguistics. 33–43.Google ScholarGoogle ScholarCross RefCross Ref
  13. Elastic. 2019. Elastic Elasticsearch. https://github.com/elastic/elasticsearch.Google ScholarGoogle Scholar
  14. Robert E. Filman and Daniel P. Friedman. 2000. Aspect-oriented programming is quantification and obliviousness. Technical Report. Research Institute for Advanced Computer Science. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Beat Fluri, Michael Wursch, and Harald C. Gall. 2007. Do code and comments coevolve? On the relation between source code and comment changes. In Working Conference on Reverse Engineering. 70–79. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Eclipse Foundation. 2019. Eclipse Java development tools (JDT). https://www. eclipse.org/jdt.Google ScholarGoogle Scholar
  17. Martin Fowler, Kent Beck, John Brant, William Opdyke, and Don Roberts. 1999. Refactoring: Improving the design of existing code. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Apache Gobblin. 2019. Apache Gobblin. https://github.com/apache/incubatorgobblin.Google ScholarGoogle Scholar
  19. Google. 2019. Google Guava. https://github.com/google/guava.Google ScholarGoogle Scholar
  20. Jhe-Jyun Guo, Nien-Lin Hsueh, Wen-Tin Lee, and Shi-Chuen Hwang. 2014. Improving software maintenance for pattern-based software development: A comment refactoring approach. In International Conference on Trustworthy Systems and their Applications. 75–79. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Elnar Hajiyev, Mathieu Verbaere, and Oege de Moor. 2006. CodeQuest: Scalable source code queries with Datalog. In European Conference on Object-Oriented Programming. 2–27. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Dorsaf Haouari, Houari Sahraoui, and Philippe Langlais. 2011. How good is your comment? A study of comments in Java programs. In International Symposium on Empirical Software Engineering and Measurement. 137–146. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Xing Hu, Ge Li, Xin Xia, David Lo, and Zhi Jin. 2018. Deep code comment generation. In International Conference on Program Comprehension. 200–210. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Qiao Huang, Emad Shihab, Xin Xia, David Lo, and Shanping Li. 2018. Identifying self-admitted technical debt in open source projects using text mining. Empirical Software Engineering 23, 1 (2018), 418–451. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Walid M. Ibrahim, Nicolas Bettenburg, Bram Adams, and Ahmed E. Hassan. 2012. On the relationship between comment update practices and software bugs. Journal of Systems and Software 85, 10 (2012), 2293–2304. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Apache Incubator-Wave. 2019. Apache Incubator-Wave. https://github.com/ apache/incubator-wave.Google ScholarGoogle Scholar
  27. Srinivasan Iyer, Ioannis Konstas, Alvin Cheung, and Luke Zettlemoyer. 2016. Summarizing source code using a neural attention model. In Annual Meeting of the Association for Computational Linguistics. 2073–2083.Google ScholarGoogle ScholarCross RefCross Ref
  28. Doug Janzen and Kris De Volder. 2003. Navigating and querying code without getting lost. In International Conference on Aspect-Oriented Software Development. 178–187. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Huiqing Li and Simon Thompson. 2012. A domain-specific language for scripting refactorings in Erlang. In Fundamental Approaches to Software Engineering. 501– 515. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Chang Liu, Xinyun Chen, Eui Chul Shin, Mingcheng Chen, and Dawn Song. 2016. Latent attention for if-then program synthesis. In Advances in Neural Information Processing Systems. 4574–4582. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Innobuilt Software LLC. 2019. All your TODO comments in one place. https: //imdone.io/.Google ScholarGoogle Scholar
  32. Everton da S Maldonado, Rabe Abdalkareem, Emad Shihab, and Alexander Serebrenik. 2017. An empirical study on the removal of self-admitted technical debt. In International Conference on Software Maintenance and Evolution. 238–248.Google ScholarGoogle ScholarCross RefCross Ref
  33. Laura Moreno, Jairo Aponte, Giriprasad Sridhara, Andrian Marcus, Lori Pollock, and K Vijay-Shanker. 2013. Automatic generation of natural language summaries for Java classes. In International Conference on Program Comprehension. 23–32.Google ScholarGoogle ScholarCross RefCross Ref
  34. Dana Movshovitz-Attias and William W Cohen. 2013. Natural language models for predicting programming comments. In Annual Meeting of the Association for Computational Linguistics. 35–40.Google ScholarGoogle Scholar
  35. Pengyu Nie, Junyi Jessy Li, Sarfraz Khurshid, Raymond Mooney, and Milos Gligoric. 2018. Natural language processing and program analysis for supporting todo comments as software evolves. In Workshops of the the AAAI Conference on Artificial Intelligence. 775–778.Google ScholarGoogle Scholar
  36. Pengyu Nie, Rishabh Rai, Junyi Jessy Li, Sarfraz Khurshid, Raymond J. Mooney, and Milos Gligoric. 2018.Google ScholarGoogle Scholar
  37. Executable trigger-action comments. CoRR abs/1808.01729 (2018).Google ScholarGoogle Scholar
  38. William F. Opdyke. 1992. Refactoring object-oriented frameworks. Ph.D. Dissertation. University of Illinois at Urbana-Champaign. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. William F. Opdyke and Ralph E. Johnson. 1990. Refactoring: An aid in designing application frameworks and evolving object-oriented systems. In Symposium on Object-Oriented Programming Emphasizing Practical Applications. 145–161.Google ScholarGoogle Scholar
  40. Alim Ozdemir, Ayse Tosun, Hakan Erdogmus, and Rui Abreu. 2018. Lightweight source code monitoring with Triggr. In Automated Software Engineering, Tool Demonstrations. 864–867. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Luca Pascarella and Alberto Bacchelli. 2017. Classifying code comments in Java open-source software systems. In International Working Conference on Mining Software Repositories. 227–237. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Hung Phan, Hoan Anh Nguyen, Tien N Nguyen, and Hridesh Rajan. 2017. Statistical learning for inference between implementations and documentation. In International Conference on Software Engineering: New Ideas and Emerging Technologies Results Track. 27–30. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Aniket Potdar and Emad Shihab. 2014. An exploratory study on self-admitted technical debt. In International Conference on Software Maintenance and Evolution. 91–100. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Chris Quirk, Raymond J Mooney, and Michel Galley. 2015. Language to Code: Learning semantic parsers for If-This-Then-That recipes.. In Annual Meeting of the Association for Computational Linguistics. 878–888.Google ScholarGoogle ScholarCross RefCross Ref
  45. Inderjot Kaur Ratol and Martin P. Robillard. 2017. Detecting fragile comments. In Automated Software Engineering. 112–122. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Justin Searls. 2019. todo_or_die. https://github.com/searls/todo_or_die.Google ScholarGoogle Scholar
  47. Giriprasad Sridhara. 2016. Automatically detecting the up-to-date status of ToDo comments in Java programs. In India Software Engineering Conference. 16–25. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. Giriprasad Sridhara, Emily Hill, Divya Muppaneni, Lori Pollock, and K Vijay-Shanker. 2010. Towards automatically generating summary comments for Java methods. In Automated Software Engineering. 43–52. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. Giriprasad Sridhara, Lori Pollock, and K Vijay-Shanker. 2011. Generating parameter comments and integrating with method summaries. In International Conference on Program Comprehension. 71–80. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. Margaret-Anne Storey, Jody Ryall, R. Ian Bull, Del Myers, and Janice Singer. 2008. TODO or to bug. In International Conference on Software Engineering. 251–260.Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. Adam Svensson. 2015. Reducing outdated and inconsistent code comments during software development: The comment validator program. Master’s thesis. Uppsala University, Information Systems.Google ScholarGoogle Scholar
  52. Lin Tan, Ding Yuan, Gopal Krishna, and Yuanyuan Zhou. 2007. /*iComment: bugs or bad comments?*/. In Symposium on Operating Systems Principles. 145–158. Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. Shin Hwei Tan, Darko Marinov, Lin Tan, and Gary T. Leavens. 2012. @tComment: Testing Javadoc comments to detect comment-code inconsistencies. In International Conference on Software Testing, Verification, and Validation. 260–269. Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. Lance Tokuda and Don Batory. 1999. Evolving object-oriented designs with refactorings. In Automated Software Engineering. 174–181. Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. TrigIt. 2019. TrigIt web page. http://cozy.ece.utexas.edu/trigit.Google ScholarGoogle Scholar
  56. Michele Tufano, Fabio Palomba, Gabriele Bavota, Massimiliano Di Penta, Rocco Oliveto, Andrea De Lucia, and Denys Poshyvanyk. 2017. There and back again: Can you compile that snapshot? Journal of Software: Evolution and Process (2017), e1838.Google ScholarGoogle Scholar
  57. Raoul-Gabriel Urma and Alan Mycroft. 2012. Programming language evolution via source code query languages. In Workshop on Evaluation and Usability of Programming Languages and Tools. 35–38. Google ScholarGoogle ScholarDigital LibraryDigital Library
  58. Raoul-Gabriel Urma and Alan Mycroft. 2015. Source-code queries with graph databases—with application to programming language usage and evolution. Science of Computer Programming 97, P1 (2015), 127–134. Google ScholarGoogle ScholarDigital LibraryDigital Library
  59. Mohsen Vakilian, Nicholas Chen, Roshanak Zilouchian Moghaddam, Stas Negara, and Ralph E. Johnson. 2013. A compositional paradigm of automating refactorings. In European Conference on Object-Oriented Programming. Berlin, Heidelberg, 527– 551. Google ScholarGoogle ScholarDigital LibraryDigital Library
  60. Mathieu Verbaere, Ran Ettinger, and Oege de Moor. 2006. JunGL: A scripting language for refactoring. In International Conference on Software Engineering. 172–181. ESEC/FSE ’19, August 26–30, 2019, Tallinn, Estonia Pengyu Nie, Rishabh Rai, Junyi Jessy Li, Sarfraz Khurshid, Raymond J. Mooney, and Milos Gligoric Google ScholarGoogle ScholarDigital LibraryDigital Library
  61. Pengcheng Yin and Graham Neubig. 2017. A syntactic neural model for generalpurpose code generation. In Annual Meeting of the Association for Computational Linguistics. 440–450.Google ScholarGoogle Scholar
  62. Annie T. T. Ying, James L. Wright, and Steven Abrams. 2005. Source code that talks: An exploration of Eclipse task comments and their implication to repository mining. In International Working Conference on Mining Software Repositories. 1–5. Google ScholarGoogle ScholarDigital LibraryDigital Library
  63. Fiorella Zampetti, Cedric Noiseux, Giuliano Antoniol, Foutse Khomh, and Massimiliano Di Penta. 2017. Recommending when design technical debt should be self-admitted. In International Conference on Software Maintenance and Evolution. 216–226.Google ScholarGoogle ScholarCross RefCross Ref

Index Terms

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

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in
        • Published in

          ACM Conferences cover image
          ESEC/FSE 2019: Proceedings of the 2019 27th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering
          August 2019
          1264 pages
          ISBN:9781450355728
          DOI:10.1145/3338906

          Copyright © 2019 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Online: 12 August 2019
          • Published: 12 August 2019

          Permissions

          Request permissions about this article.

          Request Permissions

          Qualifiers

          • research-article

          Acceptance Rates

          Overall Acceptance Rate 186 of 995 submissions, 19%

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!