skip to main content
research-article
Open Access

Overwatch: learning patterns in code edit sequences

Published:31 October 2022Publication History
Skip Abstract Section

Abstract

Integrated Development Environments (IDEs) provide tool support to automate many source code editing tasks. Traditionally, IDEs use only the spatial context, i.e., the location where the developer is editing, to generate candidate edit recommendations. However, spatial context alone is often not sufficient to confidently predict the developer’s next edit, and thus IDEs generate many suggestions at a location. Therefore, IDEs generally do not actively offer suggestions and instead, the developer is usually required to click on a specific icon or menu and then select from a large list of potential suggestions. As a consequence, developers often miss the opportunity to use the tool support because they are not aware it exists or forget to use it. To better understand common patterns in developer behavior and produce better edit recommendations, we can additionally use the temporal context, i.e., the edits that a developer was recently performing. To enable edit recommendations based on temporal context, we present Overwatch, a novel technique for learning edit sequence patterns from traces of developers’ edits performed in an IDE. Our experiments show that Overwatch has 78% precision and that Overwatch not only completed edits when developers missed the opportunity to use the IDE tool support but also predicted new edits that have no tool support in the IDE.

References

  1. J. Andersen and J. L. Lawall. 2008. Generic Patch Inference. In Proceedings of the 2008 23rd IEEE/ACM International Conference on Automated Software Engineering (ASE ’08). IEEE Computer Society, USA. 337–346. isbn:9781424421879 https://doi.org/10.1109/ASE.2008.44 Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Johannes Bader, Andrew Scott, Michael Pradel, and Satish Chandra. 2019. Getafix: Learning to Fix Bugs Automatically. Proc. ACM Program. Lang., 3, OOPSLA (2019), Article 159, Oct., 27 pages. https://doi.org/10.1145/3360585 Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. R. Bloem, H. N. Gabow, and F. Somenzi. 2006. An algorithm for strongly connected component analysis in n log n symbolic steps. Formal Methods in System Design, 28, 1 (2006), 37–56. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Shaked Brody, Uri Alon, and Eran Yahav. 2020. A structural model for contextual code changes. Proc. ACM Program. Lang., 4, OOPSLA (2020), 215:1–215:28. https://doi.org/10.1145/3428283 Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. John L. Campbell, Charles Quincy, Jordan Osserman, and Ove K. Pedersen. 2013. Coding In-depth Semistructured Interviews. Sociological Methods & Research, 42, 3 (2013), 294–320. https://doi.org/10.1177/0049124113500475 Google ScholarGoogle ScholarCross RefCross Ref
  6. Nancy Chinchor. 1992. MUC-4 Evaluation Metrics. In Proceedings of the 4th Conference on Message Understanding (MUC4 ’92). Association for Computational Linguistics, USA. 22–29. isbn:1558602739 https://doi.org/10.3115/1072064.1072067 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. William HE Day and Herbert Edelsbrunner. 1984. Efficient algorithms for agglomerative hierarchical clustering methods. Journal of classification, 1, 1 (1984), 7–24. Google ScholarGoogle ScholarCross RefCross Ref
  8. Reudismam Rolim de Sousa, Gustavo Soares, Rohit Gheyi, Titus Barik, and Loris D’Antoni. 2021. Learning Quick Fixes from Code Repositories. In SBES ’21: 35th Brazilian Symposium on Software Engineering, Joinville, Santa Catarina, Brazil, 27 September 2021 - 1 October 2021, Cristiano D. Vasconcellos, Karina Girardi Roggia, Vanessa Collere, and Paulo Bousfield (Eds.). ACM, 74–83. https://doi.org/10.1145/3474624.3474650 Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. S. R. Foster, W. G. Griswold, and S. Lerner. 2012. WitchDoctor: IDE support for real-time auto-completion of refactorings. In 2012 34th International Conference on Software Engineering (ICSE). 222–232. https://doi.org/10.1109/ICSE.2012.6227191 Google ScholarGoogle ScholarCross RefCross Ref
  10. Xiang Gao, Shraddha Barke, Arjun Radhakrishna, Gustavo Soares, Sumit Gulwani, Alan Leung, Nachiappan Nagappan, and Ashish Tiwari. 2020. Feedback-Driven Semi-Supervised Synthesis of Program Transformations. 4, OOPSLA (2020), Article 219, Nov., 30 pages. https://doi.org/10.1145/3428287 Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Xi Ge, Quinton L. DuBose, and Emerson Murphy-Hill. 2012. Reconciling Manual and Automatic Refactoring. In Proceedings of the 34th International Conference on Software Engineering (ICSE ’12). IEEE Press, 211–221. isbn:9781467310673 Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. JetBrains. 2021. ReSharper. At https://www.jetbrains.com/resharper/ Google ScholarGoogle Scholar
  13. Ameya Ketkar, Oleg Smirnov, Nikolaos Tsantalis, Danny Dig, and Timofey Bryksin. 2022. Inferring and Applying Type Changes. In 44th International Conference on Software Engineering (ICSE ’22) (ICSE ’22). https://doi.org/10.1145/3510003.3510115 Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. M. Kim, D. Notkin, D. Grossman, and G. Wilson. 2013. Identifying and Summarizing Systematic Code Changes via Rule Inference. IEEE Transactions on Software Engineering, 39, 1 (2013), 45–62. https://doi.org/10.1109/TSE.2012.16 Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Maxime Lamothe, Weiyi Shang, and Tse-Hsun Peter Chen. 2020. A3: Assisting Android API Migrations Using Code Examples. IEEE Transactions on Software Engineering, 1–1. https://doi.org/10.1109/TSE.2020.2988396 Google ScholarGoogle ScholarCross RefCross Ref
  16. Na Meng, Miryung Kim, and Kathryn S. McKinley. 2011. Sydit: creating and applying a program transformation from an example. In SIGSOFT/FSE’11 19th ACM SIGSOFT Symposium on the Foundations of Software Engineering (FSE-19) and ESEC’11: 13th European Software Engineering Conference (ESEC-13), Szeged, Hungary, September 5-9, 2011, Tibor Gyimóthy and Andreas Zeller (Eds.). ACM, 440–443. https://doi.org/10.1145/2025113.2025185 Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Na Meng, Miryung Kim, and Kathryn S. McKinley. 2013. LASE: Locating and Applying Systematic Edits by Learning from Examples. In Proceedings of the 2013 International Conference on Software Engineering (ICSE ’13). IEEE Press, 502–511. isbn:9781467330763 Google ScholarGoogle Scholar
  18. Ali Mesbah, Andrew Rice, Emily Johnston, Nick Glorioso, and Edward Aftandilian. 2019. DeepDelta: Learning to Repair Compilation Errors. In Proceedings of the 2019 27th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE 2019). Association for Computing Machinery, New York, NY, USA. 925–936. isbn:9781450355728 https://doi.org/10.1145/3338906.3340455 Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Microsoft. 2021. Visual Studio. At https://www.visualstudio.com Google ScholarGoogle Scholar
  20. Anders Miltner, Sumit Gulwani, Vu Le, Alan Leung, Arjun Radhakrishna, Gustavo Soares, Ashish Tiwari, and Abhishek Udupa. 2019. On the Fly Synthesis of Edit Suggestions. Proc. ACM Program. Lang., 3, OOPSLA (2019), Article 143, Oct., 29 pages. https://doi.org/10.1145/3360569 Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Emerson Murphy-Hill, Chris Parnin, and Andrew P. Black. 2009. How We Refactor, and How We Know It. In Proceedings of the 31st International Conference on Software Engineering (ICSE ’09). IEEE Computer Society, USA. 287–297. isbn:9781424434534 https://doi.org/10.1109/ICSE.2009.5070529 Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Stas Negara, Mihai Codoban, Danny Dig, and Ralph E. Johnson. 2014. Mining Fine-Grained Code Changes to Detect Unknown Change Patterns. In Proceedings of the 36th International Conference on Software Engineering (ICSE 2014). Association for Computing Machinery, New York, NY, USA. 803–813. isbn:9781450327565 https://doi.org/10.1145/2568225.2568317 Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Stas Negara, Mohsen Vakilian, Nicholas Chen, Ralph E. Johnson, and Danny Dig. 2012. Is It Dangerous to Use Version Control Histories to Study Source Code Evolution? In Proceedings of the 26th European Conference on Object-Oriented Programming (ECOOP’12). Springer-Verlag, Berlin, Heidelberg. 79–103. isbn:9783642310560 https://doi.org/10.1007/978-3-642-31057-7_5 Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Gordon D. Plotkin. 1970. A Note on Inductive Generalization. Machine Intelligence, 5 (1970), 153–163. Google ScholarGoogle Scholar
  25. Baishakhi Ray, Christopher Wiley, and Miryung Kim. 2012. REPERTOIRE: A Cross-System Porting Analysis Tool for Forked Software Projects. In Proceedings of the ACM SIGSOFT 20th International Symposium on the Foundations of Software Engineering (FSE ’12). Association for Computing Machinery, New York, NY, USA. Article 8, 4 pages. isbn:9781450316149 https://doi.org/10.1145/2393596.2393603 Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Reudismam Rolim, Gustavo Soares, Loris D’Antoni, Oleksandr Polozov, Sumit Gulwani, Rohit Gheyi, Ryo Suzuki, and Björn Hartmann. 2017. Learning syntactic program transformations from examples. In 2017 IEEE/ACM 39th International Conference on Software Engineering (ICSE). 404–415. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. J Saldana. 2009. The coding manual for qualitative researchers. https://doi.org/10.1108/QROM-08-2016-1408 Google ScholarGoogle ScholarCross RefCross Ref
  28. Nikolaos Tsantalis, Ameya Ketkar, and Danny Dig. 2020. RefactoringMiner 2.0. IEEE Transactions on Software Engineering, 21 pages. https://doi.org/10.1109/TSE.2020.3007722 Google ScholarGoogle ScholarCross RefCross Ref
  29. Mohsen Vakilian, Nicholas Chen, Stas Negara, Balaji Ambresh Rajkumar, Brian P. Bailey, and Ralph E. Johnson. 2012. Use, disuse, and misuse of automated refactorings. In 2012 34th International Conference on Software Engineering (ICSE). 233–243. https://doi.org/10.1109/ICSE.2012.6227190 Google ScholarGoogle ScholarCross RefCross Ref
  30. C. J. van Rijsbergen. 1979. Information Retrieval. Butterworth. isbn:0-408-70929-4 https://doi.org/10.1002/asi.4630300621 Available at Google ScholarGoogle ScholarCross RefCross Ref
  31. Shengzhe Xu, Ziqi Dong, and Na Meng. 2019. Meditor: Inference and Application of API Migration Edits. In Proceedings of the 27th International Conference on Program Comprehension (ICPC ’19). IEEE Press, Piscataway, NJ, USA. 335–346. https://doi.org/10.1109/ICPC.2019.00052 Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Pengcheng Yin, Graham Neubig, Miltiadis Allamanis, Marc Brockschmidt, and Alexander Gaunt. 2019. Learning to Represent Edits. In ICLR 2019. https://www.microsoft.com/en-us/research/publication/learning-to-represent-edits/ arXiv:1810.13337 [cs.LG] Google ScholarGoogle Scholar

Index Terms

  1. Overwatch: learning patterns in code edit sequences

          Recommendations

          Comments

          Login options

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

          Sign in

          Full Access

          • Article Metrics

            • Downloads (Last 12 months)236
            • Downloads (Last 6 weeks)24

            Other Metrics

          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!