Correct refactoring of concurrent software
Abstract
Automated refactorings as implemented in modern IDEs for Java usually make no special provisions for concurrent code. Thus, refactored programs may exhibit unexpected new concurrent behaviors. We analyze the types of such behavioral changes caused by current refactoring engines and develop techniques to make them behavior-preserving, ranging from simple techniques to deal with concurrency-related language constructs to a framework that computes and tracks synchronization dependencies. By basing our development directly on the Java Memory Model we can state and prove precise correctness results about refactoring concurrent programs. We show that a broad range of refactorings are not influenced by concurrency at all, whereas other important refactorings can be made behavior-preserving for correctly synchronized programs by using our framework. Experience with a prototype implementation shows that our techniques are easy to implement and require only minimal changes to existing refactoring engines.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 15 · Forward citations: 8.
Claims (1 — 1 Independent, 0 Dependent)
- Claim 1Independent Claim
A computer-implemented method for behavior-preserving transformation of a concurrent program, the method comprising: receiving source code with a proposed refactoring operation to be performed; transforming the source code by applying the proposed refactoring operation to create a transformed source code; creating an intermediate representation of the source code including synchronization dependence edges between two specific elements of the source code; creating an intermediate representation of the transformed source code including synchronization dependence edges; comparing the intermediate
Technical Overview & Description
Full multi-page specification text is archived at the issuing office. Read complete official specification ↗
Cited By — Indexed Forward Citations (8 of 8 total)
References Cited — Backward Prior Art (15)
Non-Patent Literature (5)
- Danny Dig and John Marrero and Michael D. Ernst, Refactoring sequential Java code for concurrency via concurrent libraries. In ICSE, pp. 397-407, 2009.
- Danny Dig and Marius Minea and Mihai Tarce and Ralph Johnson and Cosmin Radoi, ReLooper: Refactoring for Loop Parallelism in Java, in OOPSLA' 09, Oct. 25-29, 2009, Orlando Florida.
- Jan Wloka and Manu Sridharan and Frank Tip, Refactoring for reentrancy. In ESEC/SIGSOFT FSE, pp. 173-182, 2009.
- Jaroslav Sevcik and David Aspinall, On validity of program transformations in the java memory model. In ECOOP 2008 (2008), pp. 27-51.
- Jeremy Manson and William Pugh and Sarita V. Adve, The Java memory model, Proceedings of the 32nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p. 378-391, Jan. 12-14, 2005, Long Beach, California, USA.