Abstract
Software modifications are often systematic ---they consist of similar, but not identical, program changes to multiple contexts. Existing tools for systematic program transformation are limited because they require programmers to manually prescribe edits or only suggest a location to edit with a related example. This paper presents the design and implementation of a program transformation tool called SYDIT. Given an example edit, SYDIT generates a context-aware, abstract edit script, and then applies the edit script to new program locations. To correctly encode a relative position of the edits in a new location, the derived edit script includes unchanged statements on which the edits are control and data dependent. Furthermore, to make the edit script applicable to a new context using different identifier names, the derived edit script abstracts variable, method, and type names. The evaluation uses 56 systematic edit pairs from five large software projects as an oracle. SYDIT has high coverage and accuracy. For 82% of the edits (46/56), SYDIT matches the context and applies an edit, producing code that is 96% similar to the oracle. Overall, SYDIT mimics human programmers correctly on 70% (39/56) of the edits. Generation of edit scripts seeks to improve programmer productivity by relieving developers from tedious, error-prone, manual code updates. It also has the potential to guide automated program repair by creating program transformations applicable to similar contexts.
- J. Andersen. Semantic Patch Inference. Ph.D. Dissertation, University of Copenhagen, Copenhagen, Nov. 2009. Adviser-Julia L. Lawall.Google Scholar
- J. Andersen and J. L. Lawall. Generic patch inference. In ASE '08: Proceedings of the 2008 23rd IEEE/ACM International Conference on Automated Software Engineering, pages 337--346, Washington, DC, USA, 2008. IEEE Computer Society. ISBN 978-1-4244-2187-9. Google Scholar
Digital Library
- T. Apiwattanapong, A. Orso, and M. J. Harrold. A differencing algorithm for object-oriented programs. In ASE '04: Proceedings of the 19th IEEE International Conference on Automated Software Engineering, pages 2--13, Washington, DC, USA, 2004. IEEE Computer Society. ISBN 0-7695-2131-2. Google Scholar
Digital Library
- M. Boshernitsan, S. L. Graham, and M. A. Hearst. Aligning development tools with the way programmers think about code changes. In CHI '07: Proceedings of the SIGCHI conference on Human factors in computing systems, pages 567--576, New York, NY, USA, 2007. ACM. ISBN 978-1-59593-593-9. Google Scholar
Digital Library
- J. R. Cordy. The txl source transformation language. Science of Computer Programming, 61(3):190--210, 2006. ISSN 0167-6423. Google Scholar
Digital Library
- R. Cytron, J. Ferrante, B. Rosen, M. Wegman, and K. Zadeck. Efficiently computing static single assignment form and the control dependence graph. ACM Transactions on Programming Languages and Systems, 13(4):451--490, Oct. 1991. Google Scholar
Digital Library
- E. Duala-Ekoko and M. P. Robillard. Tracking code clones in evolving software. In ICSE '07: Proceedings of the 29th International Conference on Software Engineering, pages 158--167, Washington, DC, USA, 2007. IEEE Computer Society. ISBN 0-7695-2828-7. Google Scholar
Digital Library
- M. Erwig and D. Ren. A rule-based language for programming software updates. In RULE '02: Proceedings of the 2002 ACM SIGPLAN workshop on Rule-based programming, pages 67--78, New York, NY, USA, 2002. ACM. ISBN 1-58113-606-4. Google Scholar
Digital Library
- B. Fluri, M. Würsch, M. Pinzger, and H. C. Gall. Change distilling--- tree differencing for fine-grained source code change extraction. IEEE Transactions on Software Engineering, 33(11):18, November 2007. Google Scholar
Digital Library
- W. G. Griswold. Program Restructuring as an Aid to Software Maintenance. PhD thesis, University of Washington, 1991. Google Scholar
Digital Library
- W. G. Griswold, D. C. Atkinson, and C. McCurdy. Fast, flexible syntactic pattern matching and processing. In WPC '96: Proceedings of the 4th International Workshop on Program Comprehension, page 144, Washington, DC, USA, 1996. IEEE Computer Society. ISBN 0-8186-7283-8. Google Scholar
Digital Library
- J. Henkel and A. Diwan. Catchup!: Capturing and replaying refactorings to support api evolution. In ICSE '05: Proceedings of the 27th International Conference on Software Engineering, pages 274--283, New York, NY, USA, 2005. ACM. ISBN 1-59593-963-2. Google Scholar
Digital Library
- S. Horwitz. Identifying the semantic and textual differences between two versions of a program. In PLDI '90: Proceedings of the ACM SIGPLAN 1990 conference on Programming language design and implementation, pages 234--245, New York, NY, USA, 1990. ACM. ISBN 0-89791-364-7. Google Scholar
Digital Library
- J. W. Hunt and T. G. Szymanski. A fast algorithm for computing longest common subsequences. Communications of the ACM, 20(5): 350--353, 1977. ISSN 0001-0782. Google Scholar
Digital Library
- M. Kim and D. Notkin.Discovering and representing systematic code changes. In ICSE '09: Proceedings of the 2009 IEEE 31st International Conference on Software Engineering, pages 309--319, Washington, DC, USA, 2009. IEEE Computer Society. ISBN 978-1-4244-3453-4. Google Scholar
Digital Library
- M. Kim, V. Sazawal, D. Notkin, and G. Murphy. An empirical study of code clone genealogies. In ESEC/FSE-13: Proceedings of the 10th European Software Engineering Conference held jointly with 13th ACM SIGSOFT International Symposium on Foundations of Software Engineering, pages 187--196, New York, NY, USA, 2005. ACM. ISBN 1-59593-014-0. Google Scholar
Digital Library
- M. Kim, D. Notkin, and D. Grossman. Automatic inference of structural changes for matching across program versions. In ICSE '07: Proceedings of the 29th International Conference on Software Engineering, pages 333--343, Washington, DC, USA, 2007. IEEE Computer Society. ISBN 0-7695-2828-7. Google Scholar
Digital Library
- D. A. Ladd and J. C. Ramming. A*: A language for implementing language processors. IEEE Transactions on Software Engineering, 21 (11):894--901, 1995. ISSN 0098-5589. Google Scholar
Digital Library
- H. Lieberman, editor. Your Wish is My Command: Programming by Example. Morgan Kaufmann Publishers, 2001.Google Scholar
- A. Matzner, M. Minas, and A. Schulte. Efficient graph matching with application to cognitive automation. In A. Schrr, M. Nagl, and A. Zndorf, editors, Applications of Graph Transformations with Industrial Relevance, volume 5088 of Lecture Notes in Computer Science, pages 297--312. Springer Berlin / Heidelberg, 2008. Google Scholar
Digital Library
- T. Mens and T. Tourwe. A survey of software refactoring. IEEE Transactions on Software Engineering, 30(2):126--139, 2004. ISSN 0098-5589. Google Scholar
Digital Library
- R. C. Miller and B. A. Myers. Interactive simultaneous editing of multiple text regions. In Proceedings of the General Track: 2002 USENIX Annual Technical Conference, pages 161--174, Berkeley, CA, USA, 2001. USENIX Association. ISBN 1-880446-09-X. Google Scholar
Digital Library
- H. A. Nguyen, T. T. Nguyen, G. W. Jr., A. T. Nguyen, M. Kim, and T. Nguyen. A graph-based approach to api usage adaptation. In OOPSLA '10: Proceedings of the 2010 ACM SIGPLAN International Conference on Systems, Programming, Languages and Applications, page 10 pages, New York, NY, USA, 2010. ACM. Google Scholar
Digital Library
- T. T. Nguyen, H. A. Nguyen, N. H. Pham, J. M. Al-Kofahi, and T. N. Nguyen.Clone-aware configuration management.In ASE '09: Proceedings of the 2009 IEEE/ACM International Conference on Automated Software Engineering, pages 123--134, Washington, DC, USA, 2009. IEEE Computer Society. ISBN 978-0-7695-3891-4. doi: http://dx.doi.org/10.1109/ASE.2009.90. Google Scholar
Digital Library
- T. T. Nguyen, H. A. Nguyen, N. H. Pham, J. Al-Kofahi, and T. N. Nguyen. Recurring bug fixes in object-oriented programs. In ICSE '10: Proceedings of the 32nd ACM/IEEE International Conference on Software Engineering, pages 315--324, New York, NY, USA, 2010. ACM. ISBN 978-1-60558-719-6. Google Scholar
Digital Library
- W. F. Opdyke and R. E. Johnson. Refactoring: An aid in designing application frameworks and evolving object-oriented systems. In Proceedings of the Symposium on Object Oriented Programming Emphasizing Practical Applications (SOOPPA), 1990.Google Scholar
- Y. Padioleau, J. Lawall, R. R. Hansen, and G. Muller. Documenting and automating collateral evolutions in linux device drivers. In Eurosys '08: Proceedings of the 3rd ACM SIGOPS/EuroSys European Conference on Computer Systems 2008, pages 247--260, New York, NY, USA, 2008. ACM. ISBN 978-1-60558-013-5. Google Scholar
Digital Library
- J. H. Perkins, S. Kim, S. Larsen, S. Amarasinghe, J. Bachrach, M. Carbin, C. Pacheco, F. Sherwood, S. Sidiroglou, G. Sullivan, W.-F. Wong, Y. Zibin, M. D. Ernst, and M. Rinard. Automatically patching errors in deployed software. In SOSP '09: Proceedings of the ACM SIGOPS 22nd symposium on Operating systems principles, pages 87--102, New York, NY, USA, 2009. ACM. ISBN 978-1-60558-752-3. Google Scholar
Digital Library
- M. Toomim, A. Begel, and S. L. Graham. Managing duplicated code with linked editing. In VLHCC '04: Proceedings of the 2004 IEEE Symposium on Visual Languages - Human Centric Computing, pages 173--180, Washington, DC, USA, 2004. IEEE Computer Society. ISBN 0-7803-8696-5. Google Scholar
Digital Library
- E. Visser. Program transformation with Stratego/XT: Rules, strategies, tools, and systems in StrategoXT-0.9. Domain-Specific Program Generation, 3016:216--238, 2004.Google Scholar
Cross Ref
- W. Weimer, T. Nguyen, C. Le Goues, and S. Forrest. Automatically finding patches using genetic programming. In ICSE '09: Proceedings of the 31st International Conference on Software Engineering, pages 364--374, Washington, DC, USA, 2009. IEEE Computer Society. ISBN 978-1--4244-3453-4. Google Scholar
Digital Library
- W. Yang. Identifying syntactic differences between two programs. Software -- Practice & Experience, 21(7):739--755, 1991. Google Scholar
Digital Library
Index Terms
Systematic editing: generating program transformations from an example
Recommendations
Systematic editing: generating program transformations from an example
PLDI '11: Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and ImplementationSoftware modifications are often systematic ---they consist of similar, but not identical, program changes to multiple contexts. Existing tools for systematic program transformation are limited because they require programmers to manually prescribe ...
Sydit: creating and applying a program transformation from an example
ESEC/FSE '11: Proceedings of the 19th ACM SIGSOFT symposium and the 13th European conference on Foundations of software engineeringBug fixes and feature additions to large code bases often require systematic edits-similar, but not identical, coordinated changes to multiple places. This process is tedious and error-prone. Our prior work introduces a systematic editing approach that ...
A magic wand for motion capture editing and edit propagation
SA '18: SIGGRAPH Asia 2018 Technical BriefsThis paper introduces a new method for editing character animation, by using a data-driven pose distance as a falloff to interpolate edited poses seamlessly into a motion sequence. This pose distance is defined using Green's function of the pose space ...







Comments