skip to main content
10.1145/1159733.1159777acmconferencesArticle/Chapter ViewAbstractPublication PagesesemConference Proceedingsconference-collections
Article

Common refactorings, a dependency graph and some code smells: an empirical study of Java OSS

Authors Info & Claims
Published:21 September 2006Publication History

ABSTRACT

Refactoring, as a software engineering discipline has emerged over recent years to become an important aspect of maintaining software. Refactoring refers to the restructuring of software according to specific mechanics and principles. In this paper, we describe an analysis of the results from a tool whose purpose was to identify and extract refactorings from seven open-source Java systems. In particular, we analyzed the mechanics of the most commonly and least commonly applied refactorings to try and account for their frequency. Results showed the most common refactorings of the fifteen coined a 'Gang of Six', to be generally those with a high in-degree and low out-degree when mapped on a dependency graph; the same refactorings also featured strongly in the remedying of bad code smells. Remarkably and surprisingly, inheritance and encapsulationbased refactorings were found to have been applied relatively infrequently - we offer explanations for why this may be the case. The paper thus identifies 'core' refactorings central to many of the changes made by developers on open-source systems. While we can not guarantee that developers consciously undertake refactoring in any sense, the empirical results demonstrate that simple renaming and moving fields/methods between classes are common components of open-source system re-engineering. From a wider software engineering perspective, knowledge of what a modification will incur in likely sub-tasks is of value to developers whether working on open-source or other forms of software.

References

  1. D. Arsenovski. Refactoring--elixir of youth for legacy VB code. Available at: www.codeproject.com/vb/net/Refactoring_elixir.asp.Google ScholarGoogle Scholar
  2. L. Briand, C. Bunse and J. Daly. A controlled experiment for evaluating quality guidelines on the maintainability of objectoriented designs. IEEE Trans. on Software Engineering, 27(6), 2001, pages 513--530. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. D. Advani, Y. Hassoun and S. Counsell. Extracting Refactoring Trends from Open-source Software and a Possible Solution to the 'Related Refactoring' Conundrum. To appear in the Proceedings of ACM Symposium on Applied Computing, Dijon, France, April 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. S. Counsell, P. Newson and E. Mendes, Architectural Level Hypothesis Testing through Reverse Engineering of Object-Oriented Software, Proceedings of IEEE international Workshop on Program Comprehension, Limerick, Ireland, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. S. Counsell, Y. Hassoun, R. Johnson, K. Mannock and E. Mendes. Trends in Java code changes: the key identification of refactorings, ACM 2nd International Conference on the Principles and Practice of Programming in Java, Kilkenny, Ireland, June 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. S. Demeyer, S. Ducasse and O. Nierstrasz, Finding refactorings via change metrics, ACM Conference on Object Oriented Prog. Systems Languages and Applications (OOPSLA), Minneapolis, USA. pp. 166--177, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. T. Dinh-Trong and J. Bieman. Open Source Software Development: A Case Study of FreeBSD. Proceedings of 10th IEEE International Symposium on Software Metrics, Chicago, USA, 2004, pages 96--105. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. R. Ferenc, I. Siket, T. Gyimothy. Extracting Facts from Open Source Software. Proceedings of 20th International Conference on Software Maintenance (ICSM 2004), Chicago, USA, pages 60--69. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. B. Foote and W. Opdyke, Life Cycle and Refactoring Patterns that Support Evolution and Reuse. Pattern Languages of Programs (James O. Coplien and Douglas C. Schmidt, editors), Addison-Wesley, May, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. M. Fowler. Refactoring (Improving the Design of Existing Code). Addison Wesley, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. M. Godfrey and Q. Tu. Evolution in open-source software: A case study. Proceedings of International Conference on Software Maintenance (ICSM 2000), San Jose, USA. pages 131--142. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. R. Harrison, S. Counsell and R. Nithi. Experimental assessment of the effect of inheritance on the maintainability of object-oriented systems, Journal of Systems and Software, 52, 2000, pages 173--179. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. JavaCC, JavaCC Parser, Available {ONLINE} from {https://javacc.dev.java.net/}.Google ScholarGoogle Scholar
  14. JDOM, JDOM API, Available {ONLINE} from {http://www.jdom.org}.Google ScholarGoogle Scholar
  15. R. Johnson and B. Foote. Designing Reusable Classes, Journal of Object-Oriented Programming 1(2), pages 22--35. June/July 1988.Google ScholarGoogle Scholar
  16. J. Kerievsky, Refactoring to Patterns, Addison Wesley, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. T. Mens and T. Tourwe, A Survey of Software Refactoring, IEEE Transactions on Software Engineering 30(2): 126--139 (2004). Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. A. Mockus, T. Fielding and D. Herbsleb. Two case studies of open source software development: Apache and Mozilla. ACM Transactions on Software Engineering and Methodology, Vol. 11, No. 3, pages 309--346. 2002 Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. R. Najjar, S. Counsell, G. Loizou and K. Mannock. The role of constructors in the context of refactoring object-oriented software. Seventh European Conference on Software Maintenance and Reengineering (CSMR '03). Benevento, Italy, March 26-28, 2003. pages 111--120. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. R. Najjar, S. Counsell and G. Loizou. Encapsulation and the vagaries of a simple refactoring: an empirical study. Proceedings Intl. Conference on Soft. Systems Engineering and its Applications, Paris, France, December 2005.Google ScholarGoogle Scholar
  21. M. O'Cinneide and P. Nixon. Composite Refactorings for Java Programs. Proceedings of the Workshop on Formal Techniques for Java Programs. ECOOP Workshops 1998.Google ScholarGoogle Scholar
  22. W. Opdyke. Refactoring object-oriented frameworks, Ph.D. Thesis, University of Illinois. 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. D. Perry. Laws and Principles of Evolution, Panel Paper, International Conference on Software Maintenance, Montreal, Canada, pages 70--71, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Recoder, Recoder API, Available {ONLINE} from {http://recoder.sourceforge.net/}.Google ScholarGoogle Scholar
  25. L. Tokuda and D. Batory. Evolving object-oriented designs with refactorings. Automated Software Engineering, 8:89--120, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. T. Tourwe and T. Mens. Identifying Refactoring Opportunities Using Logic Meta Programming, Proc. 7th European Conference on Software Maintenance and Re-Engineering, Benevento, Italy, 2003, pages 91--100. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. M. Wu and Y. Lin. Open source software development. IEEE Computer, Volume 46, No. 6, pages 33--38. 2001.Google ScholarGoogle Scholar

Index Terms

  1. Common refactorings, a dependency graph and some code smells: an empirical study of Java OSS

      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
      • Published in

        cover image ACM Conferences
        ISESE '06: Proceedings of the 2006 ACM/IEEE international symposium on Empirical software engineering
        September 2006
        388 pages
        ISBN:1595932186
        DOI:10.1145/1159733

        Copyright © 2006 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: 21 September 2006

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • Article

        Upcoming Conference

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader