Automated Support for Program Refactoring Using Invariants

نویسندگان

  • Yoshio Kataoka
  • Michael D. Ernst
  • William G. Griswold
  • David Notkin
چکیده

Program refactoring — transforming a program to improve readability, structure, performance, abstraction, maintainability, or other characteristics — 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 particular invariants hold 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 the code base assessed their efficacy.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

An Approach to Invariant-based Program Refactoring

Refactoring tools include checking of an object-oriented program for the fulfillment of preconditions, for ensuring correctness. However, program invariants – semantic information about classes and fields assumed valid during program execution – are not considered by this precondition checking. As a result, applicability of automated refactorings is constrained in these cases, as refactorings t...

متن کامل

Toward Practical Application of Program Refactoring

Program refactoring—transforming a program to improve readability, structure, performance, abstraction, maintainability, or other characteristics— is not applied in practice as much as might be desired. Although there are various possible reasons why program refactoring is not so popular, one deterrent is the cost of detecting candidates for refactoring and of choosing the appropriate refactori...

متن کامل

Equivalence of Program Dependence Graphs in Refactoring

Program dependence graphs are widely used in computer science for example when performing optimizations, parallelization and as an internal program representation in integrated development environments. In this paper, I will look into the usefulness of program dependence graphs regarding refactoring. Refactoring is a very useful technique to improve the internal structure of a program. Many mod...

متن کامل

A Model-driven Approach to Program Refactoring

Refactoring object-oriented programs along with their associated models usually involve complex maintenance efforts, in order to keep those artifacts correct and up to date. Most projects abandon design information in the form of models early in the life cycle, as their sustentation turns out extremely expensive. In this paper, we propose an approach for refactoring object-oriented programs by ...

متن کامل

Supporting Refactoring Activities Using Histories of Program Modification

Refactoring is one of the promising techniques for improving program design by means of program transformation with preserving behavior, and is widely applied in practice. However, it is difficult for engineers to identify how and where to refactor programs, because proper knowledge and skills of a high order are required of them. In this paper, we propose the technique to instruct how and wher...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2001