Supporting Selective Undo for Refactoring

Xiao Cheng,Yuting Chen,Zhenjiang Hu,Tao Zan,Mengyu Liu,Hao Zhong,Jianjun Zhao
DOI: https://doi.org/10.1109/saner.2016.20
2016-01-01
Abstract:Due to various considerations, programmers often need to backtrack their code. Furthermore, as the most recent edit may not be the wrong edit, programmers sometimes have to backtrack their code for arbitrary edits, which is referred as selective undo in this paper. To meet the needs, researchers have proposed various approaches to support selective undo. However, to the best of our knowledge, these approaches can support only simple edits, and cannot handle refactoring, although most code editors already provide various refactoring actions. Indeed, it is challenging to support selective undo for refactoring, since multiple code elements and complicated actions can be involved. In this paper, we present a novel approach that leverages Bidirectional Transformation (BX) to support selective undo for refactoring. We evaluate our approach on a recent refactoring tool that transfers enhanced for loops to lambda expressions. Our results show that our approach achieves an accuracy of up to 89%.
What problem does this paper attempt to address?