skip to main content
article
Free Access

Identifying the semantic and textual differences between two versions of a program

Published:01 June 1990Publication History
Skip Abstract Section

Abstract

Text-based file comparators (e.g., the Unix utility diff), are very general tools that can be applied to arbitrary files. However, using such tools to compare programs can be unsatisfactory because their only notion of change is based on program text rather than program behavior. This paper describes a technique for comparing two versions of a program, determining which program components represents changes, and classifying each changed component as representing either a semantic or a textual change.

References

  1. Aho74 Aho, A., E:opcroft, J.E., and Ullman, J., The Design and Analysis of ffompater Algorithms, Addison-Wesley, Reading, MA (1974). Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Aho86 Aho, A., Sethi, R., and Ullman, J., Compilers: Principles, Techniques and Tools, Addison-Wesley, Reading, MA (1986). Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Alpern88 Alpem, B., Wegman, M3q., and Zadeck, F.K., "Detecting equality of variables in programs," pp. 1-11 in Conference Record of the Fifteenth ACM Symposium on Principles of Programming Languages, (San Diego, CA, Januaxy 13-15, 1988), AC/v{, New York (1988). Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Cytron89 Cytron, R., Ferrante, j., Rosen, B.K., Wegman, M.N., and Zadeck, K., "An efficient method of computing static single assignment form," pp. 25-35 in Conference Record of the Sixteenth ACM Symposium on Principles of Programming Languages, (Austin, TX, Jan. l 1-13, 1989), ACM, New York, NY (1989). Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Ferrante87 Ferrante, I., Ottenstem, K., and Warren, J., "The program dependence graph and its use in optimization," ACM Transactions on Progranunmg Languages and Systems, (1987). Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Hopcroft71 Hopcroft, J.E., "An n log n algorithm for minimizing the states of a finite automaton," The Theory of Machines and C omputat/ons, pp. 189-196 ( 1971).Google ScholarGoogle ScholarCross RefCross Ref
  7. Horwitz89a Horwitz, S., "Identifying the semantic and textual differences between two versions of a program," Technical Report 895, Department of Computer Sciences, University of Wisconsin---Madison (November, 1989).Google ScholarGoogle Scholar
  8. Horwitz89 Horwitz, S., Prim, l., and Reps, T., "Integrating noninterfering versions of programs," ACM Transactions on Programming Languages and Systems 11(3)pp. 345-387 (July, 1989). Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Horwitz90 Horwitz, S. and Reps, T., "Efficient comparison of program slices," Report in preparation. (1990).Google ScholarGoogle Scholar
  10. Kuck81 Kuck, DJ., Kuhn, R.H., Leasure, B., Padua, D.A., and Wolfe, M., "Dependence graphs and compiler optimizations," pp. 207-218 in Conference Record of the Eighth ACM Symposium on Principles of Programming Languages, (Williamsburg, VA, January 26-28, 1981), ACM, New York (198D. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Lu79 Lu, S.Y., "A tree-to-tree distance and its application to cluster analysis," IEEE Transactions on Pattern Analysis and Machine Intelligence PAMI-i(2) pp. 219-224 (April, 1979).Google ScholarGoogle Scholar
  12. Miller85 Miller, W. and Myers, E.W., "A file comparison program," Software- Practice and Experience 15(ll)pp. 1025-1040 (November, 1985).Google ScholarGoogle Scholar
  13. Nakatsu82 Nakatsu, N., Kambayashi, Y., and Yajima, S., "A longest common subsequence algorithm suitable for similar text strings," Acta lnformatica 18 pp. 171-179 (1982). (as cited in {Miller85})Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Ottenstein84 Ottenstein, KJ. and Ottenstein, L.M., "rhe program dependence graph in a software development environment," Proceedings of the ACM SIGSOFT/SIGPLAN Software Engineering Symposium on Practical Software Development Environments, (Pittsburgh, PA, April 23-25, 1984), ACM SIGPLAN Notices 19(5) pp. 177-184 (May, 1984). Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Rosen88 Rosen, B., Wcgman, M.N., and Zadeck, F.K., "Global value numbers and redundant computations," pp. 12-27 in Confer. ence Record of the Fifteenth ACM Symposium on Principles of Progranvning languages, (San Diego, CA, January 13-15, 1988), ACM, New York (1988). Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Sankoff72 Sankoff, D., "Matching sequences under deletionfmsertion constraints," Proc. Nat. Acad. Sci. 69(1)pp. 4-6 (January, 1972).Google ScholarGoogle ScholarCross RefCross Ref
  17. Selkow77 Selkow, S.M., "The tree-to-tree editing problem," Information Processing Letters 6(6) pp. 184-186 (December, 1977).Google ScholarGoogle ScholarCross RefCross Ref
  18. Shapiro70 Shapiro, R. M. and Saint, H., "Ttte representation of algo. rithms," Technical Reprot CA-7002-1432, Massachusetts Computer Associates (February, 1970). (as cited in {Alpem88, Roson88})Google ScholarGoogle Scholar
  19. Tai79 Tai, K.C., "The tree-to-tree correction problem," JACM 260) pp. 422-433 (July, 1979). Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Tichy84 Tichy, W., 'Whe string-to-string correction problem with block moves," ACM Trtmsactions on Computer Systems 2(4) pp. 309-321 (November, 1984). Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Wagner74 Wagner, R.A. and Fischer, M.J., "The string-to-string correction problem," JACM 21(1)pp. 168-173 (January, 1974). Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Weiser84 Weiser, M., "Program slicing," IEEE Transactions on Software Engineering SE-10(4) pp. 352-357 (July, 1984).Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Yang89 Yang, W., Horwitz, S., and Reps, T., "Detecting program components with equivalent behaviors," Technical Report 840, Department of Computer Sciences, University of Wisconsin, Madison, WI (April, 1989).Google ScholarGoogle Scholar
  24. Zhang89 Zhang, K. and Shasha, D., "Simple fast algorithms for the editing distance between trees and related problems," to appear in SIAM J. of Computing, (1989). Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Identifying the semantic and textual differences between two versions of a program

                        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

                        • Published in

                          cover image ACM SIGPLAN Notices
                          ACM SIGPLAN Notices  Volume 25, Issue 6
                          Jun. 1990
                          343 pages
                          ISSN:0362-1340
                          EISSN:1558-1160
                          DOI:10.1145/93548
                          Issue’s Table of Contents
                          • cover image ACM Conferences
                            PLDI '90: Proceedings of the ACM SIGPLAN 1990 conference on Programming language design and implementation
                            June 1990
                            351 pages
                            ISBN:0897913647
                            DOI:10.1145/93542

                          Copyright © 1990 ACM

                          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                          Publisher

                          Association for Computing Machinery

                          New York, NY, United States

                          Publication History

                          • Published: 1 June 1990

                          Check for updates

                          Qualifiers

                          • article

                        PDF Format

                        View or Download as a PDF file.

                        PDF

                        eReader

                        View online with eReader.

                        eReader