Advertisement

Automated Detection of Refactorings in Evolving Components

  • Danny Dig
  • Can Comertoglu
  • Darko Marinov
  • Ralph Johnson
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4067)

Abstract

One of the costs of reusing software components is updating applications to use the new version of the components. Updating an application can be error-prone, tedious, and disruptive of the development process. Our previous study showed that more than 80% of the disruptive changes in five different components were caused by refactorings. If the refactorings that happened between two versions of a component could be automatically detected, a refactoring tool could replay them on applications. We present an algorithm that detects refactorings performed during component evolution. Our algorithm uses a combination of a fast syntactic analysis to detect refactoring candidates and a more expensive semantic analysis to refine the results. The experiments on components ranging from 17 KLOC to 352 KLOC show that our algorithm detects refactorings in real-world components with accuracy over 85%.

Keywords

Semantic Analysis Directed Similarity Incoming Edge Related Entity Syntactic Analysis 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [APM04]
    Antoniol, G., Di Penta, M., Merlo, E.: An automatic approach to identify class evolution discontinuities. In: IWPSE 2004: Proceedings of International Workshop on Principles of Software Evolution, pp. 31–40 (2004)Google Scholar
  2. [Bor]
  3. [Bro97]
    Broder, A.: On the resemblance and containment of documents. In: SEQUENCES 1997: Proceedings of Compression and Complexity of Sequences, pp. 21–29 (1997)Google Scholar
  4. [BTF05]
    Balaban, I., Tip, F., Fuhrer, R.: Refactoring support for class library migration. In: OOPSLA 2005: Proceedings of Object-oriented programming, systems, languages, and applications, pp. 265–279. ACM Press, New York (2005)Google Scholar
  5. [DDN00]
    Demeyer, S., Ducasse, S., Nierstrasz, O.: Finding refactorings via change metrics. In: OOPSLA 2000: Proceedings of Object oriented programming, systems, languages, and applications, pp. 166–177 (2000)Google Scholar
  6. [DJ05]
    Dig, D., Johnson, R.: The role of refactorings in api evolution. In: ICSM 2005: Proceedings of International Conference on Software Maintenance, Washington, DC, USA, pp. 389–398. IEEE Computer Society Press, Los Alamitos (2005)Google Scholar
  7. [DKTE04]
    Donovan, A., Kiezun, A., Tschantz, M.S., Ernst, M.D.: Converting Java programs to use generic libraries. In: OOPSLA 2004: Proceedings of Object-oriented programming, systems, languages, and applications, pp. 15–34. ACM Press, New York (2004)Google Scholar
  8. [Ecl]
    Eclipse Foundation, http://eclipse.org
  9. [FBB+99]
    Fowler, M., Beck, K., Brant, J., Opdyke, W., Roberts, D.: Refactoring: Improving the Design of Existing Code. Adison-Wesley, London (1999)Google Scholar
  10. [GHJV95]
    Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Reading (1995)Google Scholar
  11. [GW05]
    Gorg, C., Weisgerber, P.: Detecting and visualizing refactorings from software archives. In: IWPC 2005: Proceedings of the 13th International Workshop on Program Comprehension, Washington, DC, USA, pp. 205–214. IEEE Computer Society Press, Los Alamitos (2005)CrossRefGoogle Scholar
  12. [GZ05]
    Godfrey, M.W., Zou, L.: Using origin analysis to detect merging and splitting of source code entities. IEEE Transactions on Software Engineering 31(2), 166–181 (2005)CrossRefGoogle Scholar
  13. [HD05]
    Henkel, J., Diwan, A.: CatchUp!: Capturing and replaying refactorings to support API evolution. In: ICSE 2005: Proceedings of International Conference on Software Engineering, pp. 274–283 (2005)Google Scholar
  14. [KDLT04]
    Kulkarni, P., Douglis, F., LaVoie, J.D., Tracey, J.M.: Redundancy elimination within large collections of files. In: USENIX Annual Technical Conference, General Track, pp. 59–72 (2004)Google Scholar
  15. [LLMZ04]
    Li, Z., Lu, S., Myagmar, S., Zhou, Y.: CP-Miner: A tool for finding copy-paste and related bugs in operating system code. In: OSDI 2004: Proceedings of the Sixth Symposium on Operating System Design and Implementation, pp. 289–302 (2004)Google Scholar
  16. [Man93]
    Manber, U.: Finding similar files in a large file system. Technical Report 93-33, University of Arizona (1993)Google Scholar
  17. [OJ90]
    Opdyke, B., Johnson, R.: Refactoring: An aid in designing application frameworks and evolving object-oriented systems. In: SOOPPA 1990: Proceedings of Symposium on Object-Oriented Programming Emphasizing Practical Applications (1990)Google Scholar
  18. [Opd92]
    Opdyke, B.: Refactoring Object-Oriented Frameworks. PhD thesis, University of Illinois at Urbana-Champaign (1992)Google Scholar
  19. [Rab81]
    Rabin, M.O.: Fingerprinting by random polynomials. Technical Report 15-81, Harvard University (1981)Google Scholar
  20. [RBJ97]
    Roberts, D., Brant, J., Johnson, R.E.: A refactoring tool for Smalltalk. TAPOS 3(4), 253–263 (1997)Google Scholar
  21. [RD03]
    Van Rysselberghe, F., Demeyer, S.: Reconstruction of successful software evolution using clone detection. In: IWPSE 2003: Proceedings of 6th International Workshop on Principles of Software Evolution, pp. 126–130 (2003)Google Scholar
  22. [Ref]
    RefactoringCrawler’s web page: https://netfiles.uiuc.edu/dig/RefactoringCrawler
  23. [RILD04]
    Ramaswamy, L., Iyengar, A., Liu, L., Douglis, F.: Automatic detection of fragments in dynamically generated web pages. In: WWW 2004: Proceedings of the 13th international conference on World Wide Web, pp. 443–454. ACM Press, New York (2004)CrossRefGoogle Scholar
  24. [Rob99]
    Roberts, D.: Practical Analysis for Refactoring. PhD thesis, University of Illinois at Urbana-Champaign (1999)Google Scholar
  25. [TB01]
    Tokuda, L., Batory, D.: Evolving object-oriented designs with refactorings. Automated Software Engineering 8(1), 89–120 (2001)MATHCrossRefGoogle Scholar
  26. [Tho05]
    Thomas, D.: Refactoring as meta programming? Journal of Object Technology 4(1), 7–11 (2005)CrossRefGoogle Scholar
  27. [TKB03]
    Tip, F., Kiezun, A., Bauemer, D.: Refactoring for generalization using type constraints. In: OOPSLA 2003: Proceedings of Object-oriented programing, systems, languages, and applications, pp. 13–26. ACM Press, New York (2003)Google Scholar
  28. [vDD04]
    von Dincklage, D., Diwan, A.: Converting Java classes to use generics. In: OOPSLA 2004: Proceedings of Object-oriented programming, systems, languages, and applications, pp. 1–14. ACM Press, New York (2004)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Danny Dig
    • 1
  • Can Comertoglu
    • 1
  • Darko Marinov
    • 1
  • Ralph Johnson
    • 1
  1. 1.Department of Computer ScienceUniversity of Illinois at Urbana-ChampaignUrbanaUSA

Personalised recommendations