This Article 
   
 Share 
   
 Bibliographic References 
   
 Add to: 
 
Digg
Furl
Spurl
Blink
Simpy
Google
Del.icio.us
Y!MyWeb
 
 Search 
   
Tool-Supported Refactoring of Existing Object-Oriented Code into Aspects
September 2006 (vol. 32 no. 9)
pp. 698-717
Aspect-Oriented Programming (AOP) provides mechanisms for the separation of crosscutting concerns—functionalities scattered through the system and tangled with the base code. Existing systems are a natural testbed for the AOP approach since they often contain several crosscutting concerns which could not be modularized using traditional programming constructs. This paper presents an automated approach to the problem of migrating systems developed according to the Object-Oriented Programming (OOP) paradigm into Aspect-Oriented Programming (AOP). A simple set of six refactorings has been defined to transform OOP to AOP and has been implemented in the AOP-Migrator tool, an Eclipse plug-in. A set of enabling transformations from OOP to OOP complement the initial set of refactorings. The paper presents the results of four case studies, which use the approach to migrate selected crosscutting concerns from medium-sized Java programs (in the range of 10K to 40K lines of code) into equivalent programs in AspectJ. The case study results show the feasibility of the migration and indicate the importance of the enabling transformations as a preprocessing step.

[1] D. Binkley, M. Ceccato, M. Harman, F. Ricca, and P. Tonella, “Automated Refactoring of Object Oriented Code into Aspects,” Proc. Int'l Conf. Software Maintenance (ICSM), pp. 27-36, 2005.
[2] P. Borba and S. Soares, “Refactoring and Code Generation Tools for AspectJ,” Proc. Workshop Tools for Aspect-Oriented Software Development at Conf. Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), Nov. 2002.
[3] S. Breu and J. Krinke, “Aspect Mining Using Event Traces,” Proc. Automated Software Eng. (ASE '04), pp. 310-315, Sept. 2004.
[4] M. Bruntink, A. van Deursen, and T. Tourwe, “Isolating Idiomatic Crosscutting Concerns,” Proc. Int'l Conf. Software Maintenance (ICSM), pp. 37-46, Sept. 2005.
[5] M. Bruntink, A. van Deursen, T. Tourwé, and R. van Engelen, “An Evaluation of Clone Detection Techniques for Identifying Crosscutting Concerns,” Proc. Int'l Conf. Software Maintenance (ICSM), pp. 200-209, Sept. 2004.
[6] G. Canfora, A. Cimitile, A. De Lucia, and G.A.D. Lucca, “Decomposing Legacy Programs: A First Step towards Migrating to Client-Server Platforms,” Proc. Sixth IEEE Int'l Workshop Program Comprehension, pp. 136-144, June 1998.
[7] M. Ceccato, M. Marin, K. Mens, L. Moonen, P. Tonella, and T. Tourwé, “A Qualitative Comparison of Three Aspect Mining Techniques,” Proc. 13th IEEE Int'l Workshop Program Comprehension (IWPC), pp. 13-22, May 2005.
[8] L. Cole and P. Borba, “Deriving Refactorings for AspectJ,” Proc. Fourth Int'l Conf. Aspect-Oriented Software Development (AOSD '05), pp. 123-134, 2005.
[9] J.J. Dolado, M. Harman, M.C. Otero, and L. Hu, “An Empirical Investigation of the Influence of a Type of Side Effects on Program Comprehension,” IEEE Trans. Software Eng., vol. 29, no. 7, pp. 665-670, July 2003.
[10] R. Filman and D. Friedman, “Aspect-Oriented Programming Is Quantification and Obliviousness,” Proc. Workshop Advanced Separation of Concerns at Conf. Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA '00), Oct. 2000.
[11] M. Fowler, Refactoring: Improving the Design of Existing Code. Addison-Wesley, 1999.
[12] E. Gamma, R. Helm, R. Johnson, and J. Vlissides, Design Patterns: Elements of Reusable Object Oriented Software, Addison-Wesley, 1995.
[13] W.G. Griswold, J.J. Yuan, and Y. Kato, “Exploiting the Map Metaphor in a Tool for Software Evolution,” Proc. 2001 Int'l Conf. Software Eng. (ICSE), pp. 265-274, Mar. 2001.
[14] K. Gybels and A. Kellens, “An Experiment in Using Inductive Logic Programming to Uncover Pointcuts,” Proc. First European Interactive Workshop Aspects in Software, 2004.
[15] S. Hanenberg, C. Oberschulte, and R. Unland, “Refactoring of Aspect-Oriented Software,” Proc. Fourth Ann. Int'l Conf. Object-Oriented and Internet-Based Technologies, Concepts, and Applications for a Networked World (Net.ObjectDays), pp. 19-35, Sept. 2003.
[16] J. Hannemann and G. Kiczales, “Overcoming the Prevalent Decomposition of Legacy Code,” Proc. Workshop Advanced Separation of Concerns at Int'l Conf. Software Eng. (ICSE), 2001.
[17] J. Hannemann, G.C. Murphy, and G. Kiczales, “Role-Based Refactoring of Crosscutting Concerns,” Proc. Fourth Int'l Conf. Aspect-Oriented Software Development (AOSD '05), pp. 135-146, 2005.
[18] M. Harman, L. Hu, R.M. Hierons, J. Wegener, H. Sthamer, A. Baresel, and M. Roper, “Testability Transformation,” IEEE Trans. Software Eng., vol. 30, no. 1, pp. 3-16, Jan. 2004.
[19] M. Harman, L. Hu, R.M. Hierons, X. Zhang, M. Munro, J.J. Dolado, M.C. Otero, and J. Wegener, “A Post-Placement Side-Effect Removal Algorithm,” Proc. IEEE Int'l Conf. Software Maintenance (ICSM '02), pp. 2-11, Oct. 2002.
[20] D. Janzen and K.D. Volder, “Navigating and Querying Code without Getting Lost,” Proc. Second Int'l Conf. Aspect-Oriented Software Development (AOSD), pp. 178-187, Mar. 2003.
[21] I. Kiselev, Aspect-Oriented Programming with AspectJ, 2002.
[22] A.S. Klusener and C. Verhoef, “9210: The Zip Code of Another IT-Soap,” Software Quality J., vol. 12, no. 4, pp. 297-309, 2004.
[23] R. Laddad “Aspect Oriented Refactoring Series (Part 2—The Techniques of the Trade),” http:/theserverside.com, Dec. 2003.
[24] M. Marin, “Refactoring JHotDraw's Undo Concern to AspectJ,” Proc. First Workshop Aspect Reverse Eng. (WARE '04), Nov. 2004.
[25] M. Marin, A. van Deursen, and L. Moonen, “Identifying Aspects Using Fan-In Analysis,” Proc. 11th IEEE Working Conf. Reverse Eng. (WCRE '04), Nov. 2004.
[26] M.P. Monteiro and J.M. Fernandes, “Refactoring a Java Code Base to AspectJ: An Illustrative Example,” Proc. Int'l Conf. Software Maintenance (ICSM), pp. 17-26, Sept. 2005.
[27] M.P. Monteiro and J.M. Fernandes, “Towards a Catalog of Aspect-Oriented Refactorings,” Proc. Fourth Int'l Conf. Aspect-Oriented Software Development (AOSD), pp. 111-122, Mar. 2005.
[28] M.P. Robillard and G.C. Murphy, “Concern Graphs: Finding and Describing Concerns Using Structural Program Dependencies,” Proc. 24th Int'l Conf. Software Eng. (ICSE), pp. 406-416, May 2002.
[29] D. Shepherd, E. Gibson, and L. Pollock, “Design and Evaluation of an Automated Aspect Mining Tool,” Proc. Mid-Atlantic Student Workshop Programming Languages and Systems (MASPLAS), Apr. 2004.
[30] P. Tonella and M. Ceccato, “Aspect Mining through the Formal Concept Analysis of Execution Traces,” Proc. 11th Working Conf. Reverse Eng. (WCRE), pp. 112-121, Nov. 2004.
[31] P. Tonella and M. Ceccato, “Refactoring the Aspectizable Interfaces: An Empirical Assessment,” IEEE Trans. Software Eng., vol. 31, no. 10, pp. 819-832, Oct. 2005.
[32] T. Tourwe, A. Kellens, W. Vanderperren, and F. Vannieuwenhuyse, “Inductively Generated Pointcuts to Support Refactoring to Aspects,” Proc. Software Eng. Properties of Languages for Aspect Technology (SPLAT) Workshop at Conf. Aspect-Oriented Software Development (AOSD '04), 2004.
[33] T. Tourwe and K. Mens, “Mining Aspectual Views Using Formal Concept Analysis,” Proc. Fourth IEEE Int'l Workshop Source Code Analysis and Manipulation (SCAM '04), pp. 97-106, Sept. 2004.
[34] A. van Deursen and T. Kuipers, “Identifying Objects Using Cluster and Concept Analysis,” Technical Report SEN-R9814, Centrum voor Wiskunde en Informatica (CWI), Sept. 1998.
[35] A. van Deursen, M. Marin, and L. Moonen, “Aspect Mining and Refactoring,” Proc. First Int'l Workshop Refactoring: Achievements, Challenges, Effects (REFACE), with WCRE, Nov. 2003.
[36] M. Ward, “Assembler to C Migration Using the FermaT Transformation System,” Proc. IEEE Int'l Conf. Software Maintenance (ICSM '99), Aug. 1999.

Index Terms:
Aspect-oriented software development, refactoring, program transformation.
Citation:
David Binkley, Mariano Ceccato, Mark Harman, Filippo Ricca, Paolo Tonella, "Tool-Supported Refactoring of Existing Object-Oriented Code into Aspects," IEEE Transactions on Software Engineering, vol. 32, no. 9, pp. 698-717, Sept. 2006, doi:10.1109/TSE.2006.95
Usage of this product signifies your acceptance of the Terms of Use.