Refactoring with Synthesis

被引:0
|
作者
Raychev, Veselin [1 ]
Schaefer, Max [2 ]
Sridharan, Manu [3 ]
Vechev, Martin [1 ]
机构
[1] Swiss Fed Inst Technol, Zurich, Switzerland
[2] Nanyang Technol Univ, Singapore, Singapore
[3] IBM TJ Watson Res Ctr, Yorktown Hts, NY USA
关键词
Refactoring; Synthesis;
D O I
10.1145/2544173.2509544
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Refactoring has become an integral part of modern software development, with wide support in popular integrated development environments (IDEs). Modern IDEs provide a fixed set of supported refactorings, listed in a refactoring menu. But with IDEs supporting more and more refactorings, it is becoming increasingly difficult for programmers to discover and memorize all their names and meanings. Also, since the set of refactorings is hard-coded, if a programmer wants to achieve a slightly different code transformation, she has to either apply a (possibly non-obvious) sequence of several built-in refactorings, or just perform the transformation by hand. We propose a novel synthesis system which addresses these limitations. Our system employs a recently proposed refactoring interface, in which a refactoring is achieved via three simple steps: the programmer first indicates the start of a code refactoring phase; then she performs some of the desired code changes manually; and finally, she asks the tool to complete the refactoring. Given the initial and modified programs, our synthesis system completes the refactoring by first extracting the difference between the starting program and the modified version, and then synthesizing a sequence of refactorings that achieves (at least) the desired changes. To enable scalable synthesis, we introduce local refactorings, which allow for first discovering a refactoring sequence on small program fragments and then extrapolating it to a full refactoring sequence. We implemented our approach as an Eclipse plug-in, with an architecture that is easily extendable with new refactorings. The experimental results are encouraging: with only minimal user input, the synthesizer was able to quickly discover complex refactoring sequences for several challenging realistic examples.
引用
收藏
页码:339 / 354
页数:16
相关论文
共 50 条
  • [1] Refactoring -amyrin synthesis in Saccharomyces cerevisiae
    Zhang, Genlin
    Cao, Qian
    Liu, Jingzhu
    Liu, Baiyang
    Li, Jun
    Li, Chun
    [J]. AICHE JOURNAL, 2015, 61 (10) : 3172 - 3179
  • [2] Knowledge Refactoring for Inductive Program Synthesis
    Dumancic, Sebastijan
    Guns, Tias
    Cropper, Andrew
    [J]. THIRTY-FIFTH AAAI CONFERENCE ON ARTIFICIAL INTELLIGENCE, THIRTY-THIRD CONFERENCE ON INNOVATIVE APPLICATIONS OF ARTIFICIAL INTELLIGENCE AND THE ELEVENTH SYMPOSIUM ON EDUCATIONAL ADVANCES IN ARTIFICIAL INTELLIGENCE, 2021, 35 : 7271 - 7278
  • [3] "Refactoring" Refactoring
    Waguespack, Leslie J.
    Babb, Jeffry S.
    Yates, David J.
    [J]. PROCEEDINGS OF THE 50TH ANNUAL HAWAII INTERNATIONAL CONFERENCE ON SYSTEM SCIENCES, 2017, : 4665 - 4674
  • [4] Equivalence by Canonicalization for Synthesis-Backed Refactoring
    Lubin, Justin
    Ferguson, Jeremy
    Ye, Kevin
    Yim, Jacob
    Chasins, Sarah E.
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2024, 8 (PLDI):
  • [5] SOAR: A Synthesis Approach for Data Science API Refactoring
    Ni, Ansong
    Ramos, Daniel
    Yang, Aidan Z. H.
    Lynce, Ines
    Manquinho, Vasco
    Martins, Ruben
    Le Goues, Claire
    [J]. 2021 IEEE/ACM 43RD INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2021), 2021, : 112 - 124
  • [6] Refactoring
    Fowler, M
    [J]. ICSE 2002: PROCEEDINGS OF THE 24TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, 2002, : 701 - 701
  • [7] Refactoring
    Ralf Reißing
    [J]. Informatik-Spektrum, 1999, 22 (3) : 210 - 211
  • [8] Refactoring
    Fowler, M
    [J]. TECHNOLOGY OF OBJECT-ORIENTED LANGUAGES AND SYSTEMS - TOOLS 34, PROCEEDINGS, 2000, : 437 - 437
  • [9] Replication of SOAR: A Synthesis Approach for Data Science API Refactoring
    Ni, Ansong
    Ramos, Daniel
    Yang, Aidan Z. H.
    Lynce, Ines
    Manquinho, Vasco
    Martins, Ruben
    Le Goues, Claire
    [J]. 2021 IEEE/ACM 43RD INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING: COMPANION PROCEEDINGS (ICSE-COMPANION 2021), 2021, : 190 - 191
  • [10] Program refactoring, program synthesis, and model-driven development
    Batory, Don
    [J]. Compiler Construction, Proceedings, 2007, 4420 : 156 - 171