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 条
  • [31] Barriers to Refactoring
    Tempero, Ewan
    Gorschek, Tony
    Angelis, Lefteris
    [J]. COMMUNICATIONS OF THE ACM, 2017, 60 (10) : 54 - 61
  • [32] State of Refactoring Adoption: Better Understanding Developer Perception of Refactoring
    AlOmar, Eman Abdullah
    [J]. 2023 IEEE/ACM 20TH INTERNATIONAL CONFERENCE ON MINING SOFTWARE REPOSITORIES, MSR, 2023, : 635 - 639
  • [33] Refactoring GrPPI: Generic Refactoring for Generic Parallelism in C++
    Christopher Brown
    Vladimir Janjic
    Adam D. Barwell
    J. Daniel Garcia
    Kenneth MacKenzie
    [J]. International Journal of Parallel Programming, 2020, 48 : 603 - 625
  • [34] Beyond the refactoring browser:: Advanced tool support for software refactoring
    Mens, T
    Tourwé, T
    Muñoz, F
    [J]. SIXTH INTERNATIONAL WORKSHOP ON PRINCIPLES OF SOFTWARE EVOLUTION, PROCEEDINGS, 2003, : 39 - 44
  • [35] A game of refactoring. Studying the impact of gamification in software refactoring
    Elezi, Leonard
    Sali, Sara
    Demeyer, Serge
    Murgia, Alessandro
    Perez, Javier
    [J]. PROCEEDINGS OF THE XP2016 SCIENTIFIC WORKSHOPS, 2016,
  • [36] Refactoring The MLA
    Di Jasio, Lucio
    [J]. ELECTRONICS WORLD, 2015, 121 (1953): : 14 - 16
  • [37] The refactoring browser
    Brant, J
    Roberts, D
    [J]. OBJECT-ORIENTED TECHNOLOGY: ECOOP'98 WORKSHOP READER, 1998, 1543 : 549 - 549
  • [38] Refactoring MATLAB
    Radpour, Soroush
    Hendren, Laurie
    Schaefer, Andmax
    [J]. COMPILER CONSTRUCTION, CC 2013, 2013, 7791 : 224 - 243
  • [39] Refactoring GrPPI: Generic Refactoring for Generic Parallelism in C plus
    Brown, Christopher
    Janjic, Vladimir
    Barwell, Adam D.
    Garcia, J. Daniel
    MacKenzie, Kenneth
    [J]. INTERNATIONAL JOURNAL OF PARALLEL PROGRAMMING, 2020, 48 (04) : 603 - 625
  • [40] Synthesis-Powered Optimization of Smart Contracts via Data Type Refactoring
    Chen, Yanju
    Wang, Yuepeng
    Goyal, Maruth
    Dong, James
    Feng, Yu
    Dillig, Isil
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2022, 6 (OOPSLA):