Software refactoring and rewriting: from the perspective of code transformations
Yu Liu (Institute of High Energy Physics, Chinese Academy of Sciences)

TL;DR
This paper presents a novel approach to software refactoring by modeling it as a series of code transformations, enabling automation and manual correctness analysis, demonstrated through two projects achieving significant simplification.
Contribution
It introduces a method inspired by compiler techniques to automate and analyze software refactoring processes using code transformations and pattern recognition.
Findings
Achieved 10-100x simplification in refactoring projects
Automated transformation sequences facilitate correctness analysis
Regular text processing exploits codebase-specific patterns
Abstract
To refactor already working code while keeping reliability, compatibility and perhaps security, we can borrow ideas from micropass/nanopass compilers. By treating the procedure of software refactoring as composing code transformations, and compressing repetitive transformations with automation tools, we can often obtain representations of refactoring processes short enough that their correctness can be analysed manually. Unlike in compilers, in refactoring we usually only need to consider the codebase in question, so regular text processing can be extensively used, fully exploiting patterns only present in the codebase. Aside from the direct application of code transformations from compilers, many other kinds of equivalence properties may also be exploited. In this paper, two refactoring projects are given as the main examples, where 10-100 times simplification has been achieved with…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Advanced Malware Detection Techniques · Software System Performance and Reliability
