Advertisement

Empirical Software Engineering

, Volume 24, Issue 1, pp 491–535 | Cite as

Querying distilled code changes to extract executable transformations

  • Reinout Stevens
  • Tim MolderezEmail author
  • Coen De Roover
Article
  • 60 Downloads

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.

Keywords

Change distilling Change querying Logic meta-programming 

Notes

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.

References

  1. Alexandru CV, Gall HC (2015) Rapid multi-purpose, multi-commit code analysis. In: Proceedings of the 37th international conference on software engineering (ICSE15)Google Scholar
  2. 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)Google Scholar
  3. 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)Google Scholar
  4. 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 TrackGoogle Scholar
  5. 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)Google Scholar
  6. 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)Google Scholar
  7. 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)Google Scholar
  8. 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)Google Scholar
  9. 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)Google Scholar
  10. 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)Google Scholar
  11. Frigge M, Hoaglin DC, Iglewicz B (1989) Some implementations of the boxplot. Am Stat 43(1):50–54Google Scholar
  12. 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)Google Scholar
  13. 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
  14. 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)Google Scholar
  15. 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 EngineeringGoogle Scholar
  16. 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)Google Scholar
  17. 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)Google Scholar
  18. 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)Google Scholar
  19. 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
  20. Maruyama K, Omori T, Hayashi S (2016) Slicing fine-grained code change history. IEICE Trans 99-D(3):671–687CrossRefGoogle Scholar
  21. 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)Google Scholar
  22. 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)Google Scholar
  23. de Moor O, Lacey D, Wyk EV (2002) Universal regular path queries. Higher-Order and Symbolic Computation pp 15–35Google Scholar
  24. 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)Google Scholar
  25. Murphy-Hill E, Parnin C, Black AP (2012) How we refactor, and how we know it. IEEE Trans Softw Eng 38:5–18CrossRefGoogle Scholar
  26. 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)Google Scholar
  27. Oppenheim AN (2000) Questionnaire design, interviewing and attitude measurement. Bloomsbury PublishingGoogle Scholar
  28. 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–52Google Scholar
  29. Peled D (1998) Ten years of partial order reduction. In: Hu AJ, Vardi MY (eds) Computer aided verification. Springer, Berlin, pp 17–28CrossRefGoogle Scholar
  30. 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
  31. 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)Google Scholar
  32. 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
  33. Stevens R (2015) A declarative foundation for comprehensive history querying. In: Proceedings of the 37th international conference on software engineering, doctoral symposium track (ICSE15)Google Scholar
  34. 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 evolutionGoogle Scholar
  35. 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)Google Scholar
  36. Uquillas Gómez V, Ducasse S, Kellens A (2014) Supporting streams of changes during branch integration. Sci Comput Program 96Google Scholar
  37. 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
  38. 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
  39. 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

Copyright information

© Springer Science+Business Media, LLC, part of Springer Nature 2018

Authors and Affiliations

  • Reinout Stevens
    • 1
  • Tim Molderez
    • 2
    Email author
  • Coen De Roover
    • 2
  1. 1.Maxflow BVBALeuvenBelgium
  2. 2.Software Languages LabVrije Universiteit BrusselIxellesBelgium

Personalised recommendations