Skip to main content
Log in

JDiff: A differencing technique and tool for object-oriented programs

  • Published:
Automated Software Engineering Aims and scope Submit manuscript

Abstract

During software evolution, information about changes between different versions of a program is useful for a number of software engineering tasks. For example, configuration-management systems can use change information to assess possible conflicts among updates from different users. For another example, in regression testing, knowledge about which parts of a program are unchanged can help in identifying test cases that need not be rerun. For many of these tasks, a purely syntactic differencing may not provide enough information for the task to be performed effectively. This problem is especially relevant in the case of object-oriented software, for which a syntactic change can have subtle and unforeseen effects. In this paper, we present a technique for comparing object-oriented programs that identifies both differences and correspondences between two versions of a program. The technique is based on a representation that handles object-oriented features and, thus, can capture the behavior of object-oriented programs. We also present JDiff, a tool that implements the technique for Java programs. Finally, we present the results of four empirical studies, performed on many versions of two medium-sized subjects, that show the efficiency and effectiveness of the technique when used on real programs.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11

Similar content being viewed by others

Notes

  1. A control-flow graph is a directed graph in which nodes represent statements and edges represent flow of control between statements.

  2. The ECFG is similar to the Java Interclass Graph (JIG)  (Harrold et al., 2001) in terms of the handling of variable and object types and exception constructs. However, the JIG is an inter-procedural representation of a program whereas the ECFG is an intra-procedural representation of a method with summarized information from inter-procedural analyses. In addition, the ECFG also models synchronization constructs.

  3. For efficiency, we exclude class Object from the name, except that for class Object itself.

  4. We use the subscript notation to distinguish variables in recursively called procedures.

  5. http: //www.cc.gatech.edu/aristotle/Tools/jaba.html

References

  • Apiwattanapong, T., Orso, A., Harrold, M.J.: A differencing algorithm for object-oriented programs. In: Proceedings of the 19th IEEE International Conference on Automated Software Engineering (ASE 2004), pp. 2–13 (2004)

  • Apiwattanapong, T., Orso, A., Harrold, M.J.: Efficient and precise dynamic impact analysis using execute-after sequences. In: Proceedings of the 27th IEEE and ACM SIGSOFT International Conference on Software Engineering (ICSE 2005), pp. 432–441 (2005)

  • Binkley, D.: Using semantic differencing to reduce the cost of regression testing. In: Proceedings of IEEE Conference on Software Maintenance, pp. 41–50 (1992)

  • Bohner, S.A., Arnold, R.S.: Software Change Impact Analysis. IEEE Press, Los Alamitos, CA, USA (1996)

  • Elbaum, S., Gable, D., Rothermel, G.: The impact of software evolution on code coverage information. In: Proceedings of the International Conference on Software Maintenance, pp. 169–179 (2001)

  • Ernst, M.D.: Dynamically discovering likely program invariants. Ph.D., University of Washington Department of Computer Science and Engineering, Seattle, Washington (Aug. 2000)

  • Ferrante, J., Ottenstein, K.J., Warren, J.D.: The program dependence graph and its use in optimization. ACM Trans. Program. Lang. Syst. 9(3), 319–349 (1987)

    Google Scholar 

  • Fischer, M., Pinzger, M., Gall, H.: Populating a release history database from version control and bug tracking systems. In: Proceedings of the 19th IEEE International Conference on Software Maintenance (ICSM 2003), pp. 23–32 (2003)

  • German, D.M.: Mining CVS repositories, the softChange experience. In: Proceedings of the First International Workshop on Mining Software Repositories, pp. 17–21 (2004)

  • Grass, J.E.: Cdiff: A syntax directed differencer for C++ programs. In: Proceedings of the USENIX C++ Conference, pp. 181–193 (1992)

  • Harrold, M.J., Jones, J.A., Li, T., Liang, D., Orso, A., Pennings, M., Sinha, S., Spoon, S.A., Gujarathi, A.: Regression test selection for java software. In: Proceedings of the ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, pp. 312–326 (2001)

  • Horwitz, S.: Identifying the semantic and textual differences between two versions of a program. In: Proceedings of the ACM SIGPLAN’90 Conference on Programming Language Design and Implementation, pp. 234–246 (1990)

  • Hunt, J.J., Tichy, W.F.: Extensible language-aware merging. In: Proceedingsof the International Conference on Software Maintenance, pp. 511–520 (2002)

  • Jackson, D., Ladd, D.A.: Semantic diff: A tool for summarizing the effects of modifications. In: Proceedings of the Internation Conference on Software Maintenance, pp. 243–252 (1994)

  • Laski, J., Szermer, W.: Identification of program nodifications and its applications in software maintenance. In: Proceedings of IEEE Conference on Software Maintenance, pp. 282–290 (1992)

  • Law, J., Rothermel, G.: Whole program path-based dynamic impact analysis. In: Proceedings of the 25th International Conference on Software Engineering, pp. 308–318 (2003)

  • Leung, H.K.N., White, L.: Insights into regression testing. In: Proceedings of the Conference on Software Maintenance, pp. 60–69. IEEE Computer Society Press (1989)

  • Maletic, J.I., Collard, M.L.: Supporting source code difference analysis. In: Proceedings of the 20th IEEE International Conference on Software Maintenance (ICSM 2004), pp. 210–219 (2004)

  • Mens, T.: A state-of-the-art survey on software merging. IEEE Trans. Softw. Eng. 28(5), 449–462 (2002)

    Google Scholar 

  • Myers, E.W.: An O(ND) Difference algorithm an its variations. Algorithmica 1(2), 251–266 (1986)

    Google Scholar 

  • Orso, A., Apiwattanapong, T., Harrold, M.J.: Leveraging field data for impact analysis and regression testing. In: Proceedings of the European Software Engineering Conference and ACM SIGSOFT Symposium on the Foundations of Software Engineering In (2003)

  • Orso, A., Shi, N., Harrold, M.J.: Scaling regression testing to large software systems. In: Proceedings of the ACM SIGSOFT Symposium on the Foundations of Software Engineering In (2004)

  • Raghavan, S., Rohana, R., Loen, D., Podgurski, A., Augustine, V.: Dex: A semantic-graph differencing tool for studying changes in large code bases. In: Proceedings of the 20th IEEE International Conference on Software Maintenance (ICSM 2004), pp. 188–197 (2004)

  • Rangarajan, K.: Automatic analysis of java program evolution and its relevance to regression testing. http: //www.mmsindia.com/JEvolve.html (2001)

  • Ren, X., Shah, F., Tip, F., Ryder, B.G., Chesley, O.: Chianti: A tool for change impact analysis of java programs. In: Proceedings of the 19th Annual ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, pp. 432–448 (2004)

  • Rothermel, G., Harrold, M.J.: Analyzing regression test selection techniques. IEEE Trans. Softw. Eng. 22(8), 529–551 (1996)

    Google Scholar 

  • Rothermel, G., Harrold, M.J.: A safe, efficient regressing test selection technique. ACM Trans. Softw. Eng. Methodol. 6(2), 173–210 (1997)

    Google Scholar 

  • Sinha, S., Harrold, M.J.: Analysis and testing of programs with exception handling constructs. IEEE Trans. Softw. Eng. 26(9), 849–871 (2000)

    Google Scholar 

  • the Eclipse Foundation. http: //www.eclipse.org (2001)

  • Wang, Z., Pierce, K., McFarling, S.: BMAT–A binary matching tool for stale profile propagation. J. Instruction-Level Parallelism 2 (2000)

  • Xing, Z., Stroulia, E.: UMLDiff: An algorithm for object-oriented design differencing. In: Proceedings of the 20th IEEE/ACM Conference on Automated Software Engineering, pp. 54–65 (2005)

  • Yang, W.: Identifying syntactic differences between two programs. Software–Practice Exp. 7, 739–755 (1991)

    Google Scholar 

Download references

Acknowledgments

This work was supported in part by Tata Consultancy Services, National Science Foundation awards CCR-0306372, CCR-0205422, CCR-9988294, CCR-0209322, and SBE-0123532 to Georgia Tech, and by the State of Georgia to Georgia Tech under the Yamacraw Mission. Kathy Repine implemented a preliminary version of JDiff.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Taweesup Apiwattanapong.

Additional information

An earlier version of this work has been presented at the 19th IEEE International Conference on Automated Software Engineering (ASE 2004) (Apiwattanapong et al., 2004).

Rights and permissions

Reprints and permissions

About this article

Cite this article

Apiwattanapong, T., Orso, A. & Harrold, M.J. JDiff: A differencing technique and tool for object-oriented programs. Autom Softw Eng 14, 3–36 (2007). https://doi.org/10.1007/s10515-006-0002-0

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10515-006-0002-0

Keywords

Navigation