Affiliation:
1. University of Texas, Austin, USA
2. Simon Fraser University, Vancouver, Canada
Abstract
Modifications to the data representation of an abstract data type (ADT) can require significant semantic refactoring of the code. Motivated by this observation, this paper presents a new method to automate semantic code refactoring tasks. Our method takes as input the original ADT implementation, a new data representation, and a so-called
relational representation invariant
(relating the old and new data representations), and automatically generates a new ADT implementation that is semantically equivalent to the original version. Our method is based on counterexample-guided inductive synthesis (CEGIS) but leverages three key ideas that allow it to handle real-world refactoring tasks. First, our approach reduces the underlying relational synthesis problem to a set of (simpler) programming-by-example problems, one for each method in the ADT. Second, it leverages symbolic reasoning techniques, based on logical abduction, to deduce code snippets that should occur in the refactored version. Finally, it utilizes a notion of
partial equivalence
to make inductive synthesis much more effective in this setting. We have implemented the proposed approach in a new tool called Revamp for automatically refactoring Java classes and evaluated it on 30 Java class mined from Github. Our evaluation shows that Revamp can correctly refactor the entire ADT in 97% of the cases and that it can successfully re-implement 144 out of the 146 methods that require modifications.
Funder
National Science Foundation
Publisher
Association for Computing Machinery (ACM)
Reference75 articles.
1. 2003. bind8 negative cache poison attack. https://vulners.com/freebsd/F04CC5CB-2D0B-11D8-BEAF-000A95C4D922
2. 2005. CVE-2005-0034. https://nvd.nist.gov/vuln/detail/CVE-2005-0034
3. 2009. Linux devs exterminate security bugs from kernel. https://www.theregister.com/2009/12/11/linux_kernel_bugs_patched/
4. 2013. Google Cloud Platform (GCP). https://cloud.google.com/
5. 2022. Cassandra. https://github.com/apache/cassandra
Cited by
4 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献