|
ABSTRACT
Since annotations were added to the Java language, many frameworks have moved to using annotated Plain Old Java Objects (POJOs) in their newest releases. Legacy applications are thus forced to undergo extensive restructuring in order to migrate from old framework versions to new versions based on annotations (Version Lock-in). Additionally, because annotations are embedded in the application code, changing between framework vendors may also entail largescale manual changes (Vendor Lock-in). This paper presents a novel refactoring approach that effectively solves these two problems. Our approach infers a concise set of semantics-preserving transformation rules from two versions of a single class. Unlike prior approaches that detect only simple structural refactorings, our algorithm can infer general composite refactorings and is more than 97% accurate on average. We demonstrate the effectiveness of our approach by automatically upgrading more than 80K lines of the unit testing code of four open-source Java applications to use the latest version of the popular JUnit testing framework.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
|
| |
2
|
|
| |
3
|
K. Beck and E. Gamma. Test Infected: Programmers love writing tests. Java Report, 3(7):37--50, 1998.
|
| |
4
|
|
 |
5
|
|
| |
6
|
William J. Brown , Raphael C. Malveau , Hays W. McCormick, III , Thomas J. Mowbray, AntiPatterns: refactoring software, architectures, and projects in crisis, John Wiley & Sons, Inc., New York, NY, 1998
|
| |
7
|
F. Castor and P. Borba. A language for specifying Java transformations. In V Brazilian Symposium on Programming Languages, pages 236--251, 2001.
|
 |
8
|
Sudarshan S. Chawathe , Anand Rajaraman , Hector Garcia-Molina , Jennifer Widom, Change detection in hierarchically structured information, Proceedings of the 1996 ACM SIGMOD international conference on Management of data, p.493-504, June 04-06, 1996, Montreal, Quebec, Canada
|
| |
9
|
|
| |
10
|
|
 |
11
|
|
| |
12
|
M. Cortés, M. Fontoura, and C. Lucena. A Rule-based Approach to Framework Evolution. Journal of Object Technology (JOT), 5(1), jan-feb 2006.
|
 |
13
|
|
 |
14
|
|
| |
15
|
L. DeMichiel and M. Keith. JSR 220: Enterprise JavaBeans 3.0, 2008. http://jcp.org/aboutJava/communityprocess/final/jsr220/index.html.
|
| |
16
|
D. Dig, C. Comertoglu, D. Marinov, and R. Johnson. Automated detection of refactorings in evolving components. In ECOOP, pages 404--428, 2006.
|
| |
17
|
|
 |
18
|
|
 |
19
|
|
| |
20
|
Eclipse Foundation. Eclipse Java development tools, March 2008. http://www.eclipse.org/jdt.
|
| |
21
|
|
| |
22
|
T. Genssler and V. Kuttruff. Source-to-source transformation in the large. In Modular Programming Languages, pages 254--265. Springer-Verlag, 2003.
|
 |
23
|
|
| |
24
|
|
| |
25
|
H. Lieberman. Your Wish is My Command: Programming By Example. Morgan Kaufmann, 2001.
|
| |
26
|
Y. Lin, J. Gray, and F. Jouault. DSMDiff: A differentiation tool for domain-specific models. European Journal of Information Systems, 16:349--361, 2007.
|
| |
27
|
D. Panda, D. Clarke, and M. Schincariol. EJB 3.0 migration. Technical report, Oracle, October 2005.
|
| |
28
|
R. Pawlak, C. Noguera, and N. Petitprez. Spoon: Program analysis and transformation in Java. Technical report, INRIA Research Report, 2006.
|
 |
29
|
|
| |
30
|
M. Proctor, M. Neale, P. Lin, and M. Frandsen. Drools Documentation. Technical report, JBoss Inc., 2006.
|
 |
31
|
|
| |
32
|
D. Roberts and J. Brant. Tools for making impossible changes - experiences with a tool for transforming large Smalltalk programs. Software, IEE Proceedings-, 151(2):49--56, 2004. 1462--5970.
|
| |
33
|
S. Roock and A. Havenstein. Refactoring tags for automatic refactoring of framework dependent applications. In Proc. Int'l Conf. eXtreme Programming and Flexible Processes in Software Engineering (XP), 2002.
|
| |
34
|
C. Russell. Java Data Objects 2.1, June 2007. http://db.apache.org/jdo/specifications.html.
|
 |
35
|
|
| |
36
|
R. Stuckert. JUnit reloaded, December 2006. http://today.java.net/pub/a/today/2006/12/07/junit-reloaded.html.
|
 |
37
|
|
| |
38
|
W. Tansey and E. Tilevich. Refactoring object-oriented applications for metadata-based frameworks. Technical report, Virginia Tech, January 2008.
|
| |
39
|
|
| |
40
|
D. Vines and K. Sutter. Migrating legacy Hibernate applications to OpenJPA and EJB 3.0, August 2007. http://www.ibm.com/developerworks/websphere/techjournal/0708_vines/0708_vines.html.
|
| |
41
|
E. Visser. A survey of strategies in program transformation systems. Electronic Notes in Theoretical Computer Science, 57, 2001.
|
| |
42
|
E. Visser. Program transformation with Stratego/XT: Rules, strategies, tools, and systems in StrategoXT-0.9. In Domain-Specific Program Generation, volume 3016 of Lecture Notes in Computer Science, pages 216--238. Spinger-Verlag, June 2004.
|
 |
43
|
|
| |
44
|
|
| |
45
|
|
INDEX TERMS
Primary Classification:
D.
Software
D.2
SOFTWARE ENGINEERING
D.2.3
Coding Tools and Techniques
Subjects:
Object-oriented programming
Additional Classification:
D.
Software
D.2
SOFTWARE ENGINEERING
D.2.6
Programming Environments
Subjects:
Integrated environments
D.2.7
Distribution, Maintenance, and Enhancement
Subjects:
Portability;
Enhancement**
General Terms:
Experimentation,
Languages
Keywords:
JUnit,
annotations,
eclipse,
frameworks,
java,
metadata,
refactoring,
upgrading
|