Abstract
Change distilling algorithms compute a sequence of fine-grained changes that, when executed in order, transform a given source AST into a given target AST. The resulting change sequences are used in the field of mining software repositories to study source code evolution. Unfortunately, detecting and specifying source code evolutions in such a change sequence is cumbersome. We therefore introduce a tool-supported approach that identifies minimal executable subsequences in a sequence of distilled changes that implement a particular evolution pattern, specified in terms of intermediate states of the AST that undergoes each change. This enables users to describe the effect of multiple changes, irrespective of their execution order, while ensuring that different change sequences that implement the same code evolution are recalled. Correspondingly, our evaluation is two-fold. We show that our approach is able to recall different implementation variants of the same source code evolution in histories of different software projects. We also evaluate the expressiveness and ease-of-use of our approach in a user study.
Similar content being viewed by others
Notes
These are variables only visible in the body of in-current-es. If these variables need to be available in other parts of the query a user needs to explicitly bind them to a logic variable.
Throughout this paper, logic variables are prefixed with a question mark.
Keep in mind that the approach currently only looks for minimal, executable solutions. As illustrated in Fig. 17, the approach disregards whether or not a distilled change sequence is realistic, i.e. a sequence that a developer might intuitively consider to transform one piece of code into another.
All material that was provided in the user study, including the study’s complete results, are available online: http://soft.vub.ac.be/~tmoldere/qwalkeko
Based on the org.eclipse.jdt.astview plugin
This refers to the API documentation for all classes in the org.eclipse.jdt.core.dom package.
This paper uses Tukey box plots (Frigge et al. 1989), the default type of box plots produced by the R language.
References
Alexandru CV, Gall HC (2015) Rapid multi-purpose, multi-commit code analysis. In: Proceedings of the 37th international conference on software engineering (ICSE15)
Chawathe SS, Rajaraman A, Garcia-Molina H, Widom J (1996) Change detection in hierarchically structured information. In: Proceedings of the international conference on management of data (SIGMOD96)
Christophe L, Stevens R, De Roover C (2014) Prevalence and maintenance of automated functional tests for web applications. In: Proceedings of the international conference on software maintenance and evolution (ICSME14)
De Roover C, Inoue K (2014) The ekeko/x program transformation tool. In: Proceedings of 14th Int working conference on source code analysis and manipulation (SCAM14), Tool Demo Track
De Roover C, Stevens R (2014) Building development tools interactively using the ekeko meta-programming library. In: Proceedings of the European conference on software maintenance and reengineering (CSMR14)
De Roover C, Noguera C, Kellens A, Jonckers V (2011) The SOUL tool suite for querying programs in symbiosis with Eclipse. In: Proceedings of the 9th international conference on principles and practice of programming in java (PPPJ11)
Dyer R, Nguyen HA, Rajan H, Nguyen TN (2013) Boa: a language and infrastructure for analyzing ultra-large-scale software repositories. In: Proceedings of the international conference on software engineering (ICSE13)
Ebraert P, Vallejos J, Costanza P, Paesschen EV, D’Hondt T (2007) Change-oriented software engineering. In: Proceedings of the 2007 international conference on dynamic languages (ICDL07)
Falleri JR, Morandat F, Blanc X, Martinez M, Montperrus M (2014) Fine-grained and accurate source code differencing. In: Proceedings of the 29th international conference on automated software engineering (ASE14)
Fluri B, Würsch M, Pinzger M, Gall HC (2007) Change distilling: Tree differencing for fine-grained source code change extraction. Trans Softw Eng 33(11)
Frigge M, Hoaglin DC, Iglewicz B (1989) Some implementations of the boxplot. Am Stat 43(1):50–54
Hajiyev E, Verbaere M, Moor OD (2006) Codequest: Scalable source code queries with datalog. In: Proceedings of the 20th European conference on object-oriented programming (ECOOP06)
Hayashi S, Omori T, Zenmyo T, Maruyama K, Saeki M (2012) Refactoring edit history of source code. In: 2012 28th IEEE international conference on software maintenance (ICSM), pp 617–620. https://doi.org/10.1109/ICSM.2012.6405336
Hindle A, German DM (2005) SCQL: A formal model and a query language for source control repositories. In: Proceedings of the 2005 working conference on mining software repositories (MSR05)
Kamiya T, Kusumoto S, Inoue K (2002) Ccfinder: a multilinguistic token-based code clone detection system for large scale source code. IEEE Transactions on Software Engineering
Lin Z, Whitehead J (2015) Why power laws?: an explanation from fine-grained code changes. In: Proceedings of the 12th working conference on mining software repositories (MSR15)
Liu YA, Rothamel T, Yu F, Stoller SD, Hu N (2004) Parametric regular path queries. In: Proceedings of the conference on programming language design and implementation (PLDI04)
Martin M, Livshits B, Lam MS (2005) Finding application errors and security flaws using pql: a program query language. In: Proceedings of the 20th conference on object-oriented programming, systems, languages, and applications (OOPSLA05)
Martinez M, Duchien L, Monperrus M (2013) Automatically extracting instances of code change patterns with ast analysis. In: 2013 IEEE international conference on software maintenance, pp 388–391. https://doi.org/10.1109/ICSM.2013.54
Maruyama K, Omori T, Hayashi S (2016) Slicing fine-grained code change history. IEICE Trans 99-D(3):671–687
Meng N, Kim M, McKinley KS (2013) Lase: locating and applying systematic edits by learning from examples. In: Proceedings of the 35th international conference on software engineering (ICSE13)
Molderez T, Stevens R, De Roover C (2017) Mining change histories for unknown systematic edits. In: Proceedings of the 14th international conference on mining software repositories (MSR17)
de Moor O, Lacey D, Wyk EV (2002) Universal regular path queries. Higher-Order and Symbolic Computation pp 15–35
Mougenot A, Blanc X, Gervais. MP (2009) D-Praxis: A peer-to-peer collaborative model editing framework. In: Proceedings of the 9th international conference on distributed applications and interoperable systems (DAIS09)
Murphy-Hill E, Parnin C, Black AP (2012) How we refactor, and how we know it. IEEE Trans Softw Eng 38:5–18
Negara S, Codoban M, Dig D, Johnson RE (2014) Mining fine-grained code changes to detect unknown change patterns. In: Proceedings of the 36th international conference on software engineering (ICSE14)
Oppenheim AN (2000) Questionnaire design, interviewing and attitude measurement. Bloomsbury Publishing
Palix N, Falleri J, Lawall J (2015) Improving pattern tracking with a language-aware tree differencing algorithm. In: Proceedings of the 22nd international conference on software analysis, evolution, and reengineering (SANER15), pp 43–52
Peled D (1998) Ten years of partial order reduction. In: Hu AJ, Vardi MY (eds) Computer aided verification. Springer, Berlin, pp 17–28
Pérez J (2013) Refactoring planning for design smell correction: Summary, opportunities and lessons learned. In: 2013 IEEE international conference on software maintenance, pp 572–577. https://doi.org/10.1109/ICSM.2013.98
Prete K, Rachatasumrit N, Sudan N, Kim M (2010) Template-based reconstruction of complex refactorings. In: Proceedings of the 2010 international conference on software maintenance (ICSM10)
Servant F, Jones JA (2012) History slicing: assisting code-evolution tasks. In: Proceedings of the ACM SIGSOFT 20th international symposium on the foundations of software engineering, FSE ’12. ACM, New York, pp 43:1–43:11. https://doi.org/10.1145/2393596.2393646
Stevens R (2015) A declarative foundation for comprehensive history querying. In: Proceedings of the 37th international conference on software engineering, doctoral symposium track (ICSE15)
Stevens R, De Roover C (2014) Querying the history of software projects using QWALKEKO. In: Proceedings of the 30th international conference on software maintenance and evolution
Stevens R, De Roover C (2017) Extracting executable transformations from distilled code changes. In: Proceedings of the 24th international conference on software analysis, evolution and reengineering (SANER17)
Uquillas Gómez V, Ducasse S, Kellens A (2014) Supporting streams of changes during branch integration. Sci Comput Program 96
Vallée-Rai R, Co P, Gagnon E, Hendren L, Lam P, Sundaresan V (1999) Soot - a java bytecode optimization framework. In: Proceedings of the 1999 conference of the centre for advanced studies on collaborative research, CASCON ’99. IBM Press, p 13. http://dl.acm.org/citation.cfm?id=781995.782008
Weissgerber P, Diehl S (2006) Identifying refactorings from source-code changes. In: 21st IEEE/ACM international conference on automated software engineering (ASE’06), pp 231–240. https://doi.org/10.1109/ASE.2006.41
Yoon YS, Myers BA (2015) Supporting selective undo in a code editor. In: Proceedings of the 37th international conference on software engineering - vol 1, ICSE ’15. IEEE Press, Piscataway, pp 223–233. http://dl.acm.org/citation.cfm?id=2818754.2818784
Acknowledgements
We would like to thank all participants of our user study. We would also like to thank the anonymous reviewers for their detailed reading of this manuscript and their high-quality feedback.
Author information
Authors and Affiliations
Corresponding author
Additional information
Communicated by: Gabriele Bavota and Andrian Marcus
Publisher’s Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
About this article
Cite this article
Stevens, R., Molderez, T. & De Roover, C. Querying distilled code changes to extract executable transformations. Empir Software Eng 24, 491–535 (2019). https://doi.org/10.1007/s10664-018-9644-3
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10664-018-9644-3