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

Published: 21 September 2006 Publication 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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[10]
M. Fowler. Refactoring (Improving the Design of Existing Code). Addison Wesley, 1999.
[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.
[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.
[13]
JavaCC, JavaCC Parser, Available {ONLINE} from {https://javacc.dev.java.net/}.
[14]
JDOM, JDOM API, Available {ONLINE} from {http://www.jdom.org}.
[15]
R. Johnson and B. Foote. Designing Reusable Classes, Journal of Object-Oriented Programming 1(2), pages 22--35. June/July 1988.
[16]
J. Kerievsky, Refactoring to Patterns, Addison Wesley, 2004.
[17]
T. Mens and T. Tourwe, A Survey of Software Refactoring, IEEE Transactions on Software Engineering 30(2): 126--139 (2004).
[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
[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.
[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.
[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.
[22]
W. Opdyke. Refactoring object-oriented frameworks, Ph.D. Thesis, University of Illinois. 1992.
[23]
D. Perry. Laws and Principles of Evolution, Panel Paper, International Conference on Software Maintenance, Montreal, Canada, pages 70--71, 2002.
[24]
Recoder, Recoder API, Available {ONLINE} from {http://recoder.sourceforge.net/}.
[25]
L. Tokuda and D. Batory. Evolving object-oriented designs with refactorings. Automated Software Engineering, 8:89--120, 2001.
[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.
[27]
M. Wu and Y. Lin. Open source software development. IEEE Computer, Volume 46, No. 6, pages 33--38. 2001.

Cited By

View all
  • (2023)Improving the Quality of Open Source SoftwareAgile Software Development10.1002/9781119896838.ch16(309-323)Online publication date: 8-Feb-2023
  • (2022)Exploring the relationship between refactoring and code debt indicatorsJournal of Software: Evolution and Process10.1002/smr.2447Online publication date: 3-Mar-2022
  • (2018)A systematic literature review: Refactoring for disclosing code smells in object oriented softwareAin Shams Engineering Journal10.1016/j.asej.2017.03.0029:4(2129-2151)Online publication date: Dec-2018
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

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
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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 21 September 2006

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. code smells
  2. refactoring
  3. taxonomy
  4. testing

Qualifiers

  • Article

Conference

ISESE06
Sponsor:

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)8
  • Downloads (Last 6 weeks)1
Reflects downloads up to 14 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2023)Improving the Quality of Open Source SoftwareAgile Software Development10.1002/9781119896838.ch16(309-323)Online publication date: 8-Feb-2023
  • (2022)Exploring the relationship between refactoring and code debt indicatorsJournal of Software: Evolution and Process10.1002/smr.2447Online publication date: 3-Mar-2022
  • (2018)A systematic literature review: Refactoring for disclosing code smells in object oriented softwareAin Shams Engineering Journal10.1016/j.asej.2017.03.0029:4(2129-2151)Online publication date: Dec-2018
  • (2018)An Approach for Semantically-Enriched Recommendation of Refactorings Based on the Incidence of Code SmellsEnterprise Information Systems10.1007/978-3-319-93375-7_15(313-335)Online publication date: 16-Jun-2018
  • (2016)Software development and tool usability2016 IEEE 24th International Conference on Program Comprehension (ICPC)10.1109/ICPC.2016.7503730(1-4)Online publication date: May-2016
  • (2015)An Empirical Study of Long Method and God Method in Industrial ProjectsProceedings of the 2015 30th IEEE/ACM International Conference on Automated Software Engineering Workshop (ASEW)10.1109/ASEW.2015.15(109-114)Online publication date: 9-Nov-2015
  • (2015)Software Developer Activity as a Source for Identifying Hidden Source Code DependenciesSOFSEM 2015: Theory and Practice of Computer Science10.1007/978-3-662-46078-8_37(449-462)Online publication date: 2015
  • (2013)Systematic testing of refactoring engines on real software projectsProceedings of the 27th European conference on Object-Oriented Programming10.1007/978-3-642-39038-8_26(629-653)Online publication date: 1-Jul-2013
  • (2012)Issues arising from refactoring studiesACM SIGSOFT Software Engineering Notes10.1145/2180921.218092237:3(1-5)Online publication date: 16-May-2012
  • (2012)How We Refactor, and How We Know ItIEEE Transactions on Software Engineering10.1109/TSE.2011.4138:1(5-18)Online publication date: 1-Jan-2012
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media