Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1109/ICSM.2001.972794guideproceedingsArticle/Chapter ViewAbstractPublication PagesConference Proceedingsacm-pubtype
Article
Free access

Automated Support for Program Refactoring using Invariants

Published: 07 November 2001 Publication History

Abstract

Program refactoring - transforming a program to improve readability, structure, performance, abstraction, maintainability, or other features - is not applied in practice as much as might be desired. One deterrent is the cost of detecting candidates for refactoring and of choosing the appropriate refactoring transformation. This paper demonstrates the feasibility of automatically finding places in the program that are candidates for specific refactorings. The approach uses program invariants: when a particular pattern of invariant relationships appears at a program point, a specific refactoring is applicable. Since most programs lack explicit invariants, an invariant detection tool called Daikon is used to infer the required invariants. We developed an invariant pattern matcher for several common refactorings and applied it to an existing Java code base. Numerous refactorings were detected, and one of the developers of th code base assesed their efficacy.

References

[1]
Henry G. Baker. 'Use-once' variables and linear objects - storage management, reflection and multi-threading. SIGPLAN Notices, 30(1):45-52, January 1995.
[2]
Kent Beck. Extreme Programming Explained: Embrace Change. Addison-Wesley, 1999.
[3]
Robert W. Bowdidge and William G. Griswold. Supporting the restructuring of data abstractions through manipulation of a program visualization. ACM Transactions on Software Engineering and Methodology, 7(2), April 1998.
[4]
Robert W. Bowdidge. Supporting the Restructuring of Data Abstractions through Manipulation of a Program Visualization. PhD thesis, University of California, San Diego, Department of Computer Science & Engineering, November 1995. Technical Report CS95-457.
[5]
Michael D. Ernst, Adam Czeisler, William G. Griswold, and David Notkin. Quickly detecting relevant program invariants. In Proceedings of the 22nd International Conference on Software Engineering, pages 449-458, Limerick, Ireland, June 7- 9, 2000. To appear in ACM Transactions on Software Engineering and Methodology.
[6]
Michael D. Ernst, Jake Cockrell, William G. Griswold, and David Notkin. Dynamically discovering likely program invariants to support program evolution. IEEE Transactions on Software Engineering, 27(2):1-25, February 2001. A previous version appeared in Proceedings of the 21st International Conference on Software Engineering, pages 213-224, Los Angeles, CA, USA, May 19-21, 1999.
[7]
Michael D. Ernst, William G. Griswold, Yoshio Kataoka, and David Notkin. Dynamically discovering pointer-based program invariants. Technical Report UW-CSE-99-11-02, University of Washington, Seattle, WA, November 16, 1999.
[8]
Michael D. Ernst. Dynamically Discovering Likely Program Invariants. PhD thesis, University of Washington Department of Computer Science and Engineering, Seattle, Washington, August 2000.
[9]
Martin Fowler, Kent Beck, John Brant, William Opdyke, and Don Roberts. Refactoring: Improving the Design of Existing Code. Addison-Wesley, 1999.
[10]
William G. Griswold, Morison I. Chen, Robert W. Bowdidge, Jenny L. Cabaniss, Van B. Nguyen, and J. David Morgenthaler. Tool support for planning the restructuring of data abstractions in large systems. IEEE Transactions on Software Engineering, 24(7):534-558, July 1998.
[11]
Erich Gamma, Richard Helm, Ralph E. Johnson, and John Vlissides. Design Patterns. Addison-Wesley, Reading, MA, 1995.
[12]
William G. Griswold and David Notkin. Automated assistance for program restructuring. ACM Transactions on Software Engineering and Methodology, 2(3):228-269, July 1993.
[13]
William G. Griswold. Program Restructuring as an Aid to Software Maintenance. PhD thesis, University of Washington, Dept. of Computer Science & Engineering, August 1991. Technical Report No. 91-08-04.
[14]
William G. Griswold. Coping with change using information transparency. Technical Report CS98-585, University of California, San Diego, Department of Computer Science and Engineering, April 1998 (Revised August 1998).
[15]
William G. Griswold, Jimmy J. Yuan, and Yoshikiyo Kato. Exploiting the map metaphor in a tool for software evolution. In Proceedings of the 2001 International Conference on Software Engineering, May 2001.
[16]
K. A. Kontogiannis, R. DeMori, E. Merlo, M. Galler, and Others. Pattern matching for clone and concept detection. Automated Software Engineering, 3(1-2):77-108, June 1996.
[17]
Ivan Moore. Automatic inheritance hierarchy restructuring and method refactoring. In Proceedings of the Eleventh Annual Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA), pages 235-250, 1996.
[18]
Ivan R. Moore. Automatic Restructuring of Object-Oriented Programs. PhD thesis, University of Manchester, 1996.
[19]
William F. Opdyke and Ralph E. Johnson. Refactoring: An aid in designing application frameworks and evolving object-oriented systems. In Proceedings of SOOPPA '90: Symposium on Object-Oriented Programming Emphasizing Practical Applications, Sep 1990.
[20]
William F. Opdyke. Refactoring Object-Oriented Frameworks . PhD thesis, University of Illinois at Urbana-Champaign, 1992.
[21]
Don Roberts, John Brant, and Ralph Johnson. A refactoring tool for Smalltalk. Theory and Practice of Object Systems, 3(4):253-63, 1997.
[22]
Donald Bradley Roberts. Practical Analysis for Refactoring. PhD thesis, University of Illinois at Urbana-Champaign, 1999.
[23]
David Ungar and Randall B. Smith. Self: The power of simplicity. In Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 227-241, 1987.

Cited By

View all
  • (2024)Semantic Code Refactoring for Abstract Data TypesProceedings of the ACM on Programming Languages10.1145/36328708:POPL(816-847)Online publication date: 5-Jan-2024
  • (2023)Search Mechanism for Encapsulate Classes with Factory Refactoring OpportunitiesProceedings of the 17th Brazilian Symposium on Software Components, Architectures, and Reuse10.1145/3622748.3622752(31-40)Online publication date: 25-Sep-2023
  • (2021)An automatic refactoring framework for replacing test-production inheritance by mocking mechanismProceedings of the 29th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3468264.3468590(540-552)Online publication date: 20-Aug-2021
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image Guide Proceedings
ICSM '01: Proceedings of the IEEE International Conference on Software Maintenance (ICSM'01)
November 2001
722 pages
ISBN:0769511899

Publisher

IEEE Computer Society

United States

Publication History

Published: 07 November 2001

Author Tags

  1. dynamic analysis
  2. invariant
  3. maintainability
  4. program understanding
  5. readability
  6. refactoring
  7. static analysis

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)23
  • Downloads (Last 6 weeks)0
Reflects downloads up to 27 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Semantic Code Refactoring for Abstract Data TypesProceedings of the ACM on Programming Languages10.1145/36328708:POPL(816-847)Online publication date: 5-Jan-2024
  • (2023)Search Mechanism for Encapsulate Classes with Factory Refactoring OpportunitiesProceedings of the 17th Brazilian Symposium on Software Components, Architectures, and Reuse10.1145/3622748.3622752(31-40)Online publication date: 25-Sep-2023
  • (2021)An automatic refactoring framework for replacing test-production inheritance by mocking mechanismProceedings of the 29th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3468264.3468590(540-552)Online publication date: 20-Aug-2021
  • (2020)LCCSSProceedings of the 14th Brazilian Symposium on Software Components, Architectures, and Reuse10.1145/3425269.3425283(91-100)Online publication date: 19-Oct-2020
  • (2020)Increasing the Trust In Refactoring Through VisualizationProceedings of the IEEE/ACM 42nd International Conference on Software Engineering Workshops10.1145/3387940.3392190(334-341)Online publication date: 27-Jun-2020
  • (2020)HeteroRefactorProceedings of the ACM/IEEE 42nd International Conference on Software Engineering10.1145/3377811.3380340(493-505)Online publication date: 27-Jun-2020
  • (2018)Identifying refactoring opportunities for replacing type code with subclass and stateProceedings of the ACM on Programming Languages10.1145/32765082:OOPSLA(1-28)Online publication date: 24-Oct-2018
  • (2016)Multi-Criteria Code Refactoring Using Search-Based Software EngineeringACM Transactions on Software Engineering and Methodology10.1145/293263125:3(1-53)Online publication date: 30-Jun-2016
  • (2015)Evaluating Quality of Primary Studies on Determining Object-Oriented Code Refactoring CandidatesProceedings of the The International Conference on Engineering & MIS 201510.1145/2832987.2833026(1-5)Online publication date: 24-Sep-2015
  • (2015)Many-Objective Software Remodularization Using NSGA-IIIACM Transactions on Software Engineering and Methodology10.1145/272997424:3(1-45)Online publication date: 13-May-2015
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media