This Article 
 Bibliographic References 
 Add to: 
On the Use of Clone Detection for Identifying Crosscutting Concern Code
October 2005 (vol. 31 no. 10)
pp. 804-818
Magiel Bruntink, IEEE Computer Society
Tom Tourw?, IEEE
In systems developed without aspect-oriented programming, code implementing a crosscutting concern may be spread over many different parts of a system. Identifying such code automatically could be of great help during maintenance of the system. First of all, it allows a developer to more easily find the places in the code that must be changed when the concern changes and, thus, makes such changes less time consuming and less prone to errors. Second, it allows the code to be refactored to an aspect-oriented solution, thereby improving its modularity. In this paper, we evaluate the suitability of clone detection as a technique for the identification of crosscutting concerns. To that end, we manually identify five specific crosscutting concerns in an industrial C system and analyze to what extent clone detection is capable of finding them. We consider our results as a stepping stone toward an automated "aspect miner” based on clone detection.

[1] P. Tarr, H. Ossher, W. Harrison, and S.M.J. Sutton, “N Degrees of Separation: Multi-Dimensional Separation of Concerns,” Proc. 21st Int'l Conf. Software Eng. (ICSE '99), pp. 107-119, May 1999.
[2] E. Soloway, R. Lampert, S. Letovsky, D. Littman, and J. Pinto, “Designing Documentation to Compensate for Delocalized Plans,” Comm. ACM, vol. 31, no. 11, pp. 1259-1267, 1988.
[3] J. Hannemann and G. Kiczales, “Overcoming the Prevalent Decomposition in Legacy Code,” Proc. ICSE Workshop Advanced Separation of Concerns, May 2001,
[4] M. Kim, L. Bergman, T.A. Lau, and D. Notkin, “An Ethnographic Study of Copy and Paste Programming Practices in OOPL,” Proc. Int'l Symp. Empirical Software Eng. (ISESE '04), pp. 83-92, Aug. 2004.
[5] J. Johnson, “Identifying Redundancy in Source Code Using Fingerprints,” Proc. IBM Centre for Advanced Studies Conf. (CASCON '93), pp. 171-183, Oct. 1993.
[6] S. Ducasse, M. Rieger, and S. Demeyer, “A Language Independent Approach for Detecting Duplicated Code,” Proc. Int'l Conf. Software Maintenance (ICSM '99), pp. 109-118, 1999.
[7] T. Kamiya, S. Kusumoto, and K. Inoue, “CCFinder: A Multilinguistic Token-Based Code Clone Detection System for Large Scale Source Code,” IEEE Trans. Software Eng., vol. 28, no. 7, pp. 645-670, July 2002.
[8] B.S. Baker, “On Finding Duplication and Near-Duplication in Large Software Systems,” Proc. Second Working Conf. Reverse Eng. (WCRE '95), pp. 86-95, July 1995.
[9] I.D. Baxter, A. Yahin, L. Moura, M. Sant'Anna, and L. Bier, “Clone Detection Using Abstract Syntax Trees,” Proc. Int'l Conf. Software Maintenance (ICSM '98), pp. 368-377, Nov. 1998.
[10] R. Komondoor and S. Horwitz, “Using Slicing to Identify Duplication in Source Code,” Proc. Eighth Int'l Symp. Static Analysis (SAS '01), pp. 40-56, July 2001.
[11] J. Krinke, “Identifying Similar Code With Program Dependence Graphs,” Proc. Eight Working Conf. Reverse Eng. (WCRE '01), pp. 301-109, 2001.
[12] J. Mayrand, C. Leblanc, and E. Merlo, “Experiment on the Automatic Detection of Function Clones in a Software System Using Metrics,” Proc. Int'l Conf. Software Maintenance (ICSM '96), pp. 244-254, Nov. 1996.
[13] A. Marcus and J.I. Maletic, “Identification of High-Level Concept Clones in Source Code. ” Proc. 16th IEEE Int'l Conf. Automated Software Eng. (ASE '01), pp. 107-114, Nov. 2001.
[14] G. Mishne and M. de Rijke, “Source Code Retrieval Using Conceptual Similarity,” Proc. 2004 Conf. Computer Assisted Information Retrieval (RIAO '04), pp. 539-554, Apr. 2004.
[15] M. Rieger, S. Ducasse, and G. Golomingi, “Tool Support for Refactoring Duplicated OO Code,” Proc. European Conf. Object-Oriented Programming (ECOOP '99), pp. 177-178, June 1999.
[16] M. Balazinska, E. Merlo, M. Dagenais, B. Laguë, and K. Kontogiannis, “Advanced Clone-Analysis to Support Object-Oriented System Refactoring,” Proc. Seventh Working Conf. Reverse Eng. (WCRE '00), pp. 98-107, Nov. 2000.
[17] F. van Rysselberghe and S. Demeyer, “Evaluating Clone Detection Techniques from a Refactoring Perspective,” Proc. Ninth IEEE Int'l Conf. Automated Software Eng. (ASE '04), pp. 336-339, Sept. 2004.
[18] R. Fanta and R. Václav, “Removing Clones from the Code,” J. Software Maintenance: Research and Practice, vol. 11, no. 4, pp. 223-243, July/Aug. 1999.
[19] F. van Rysselberghe and S. Demeyer, “Reconstruction of Successful Software Evolution Using Clone Detection,” Proc. Sixth Int'l Workshop Principles of Software Evolution (IWPSE '03), pp. 126-130, Sept. 2003.
[20] A. Walenstein, “Problems Creating Task-Relevant Clone Detection Reference Data,” Proc. 10th Working Conf. Reverse Eng. (WCRE '03), pp. 285-294, Nov. 2003.
[21] A. Walenstein and A. Lakhotia, “Clone Detector Evaluation Can Be Improved: Ideas from Information Retrieval,” Proc. Second Int'l Workshop the Detection of Software Clones (IWDSC '03), pp. 11-12, Nov. 2003.
[22] W.G. Griswold, J.J. Yuan, and Y. Kato, “Exploiting the Map Metaphor in a Tool for Software Evolution,” Proc. Int'l Conf. Software Eng. (ICSE '01), pp. 265-274, Mar. 2001.
[23] G.C. Murphy, W.G. Griswold, M.P. Robillard, J. Hannemann, and W. Leong, “Design Recommendations for Concern Elaboration Tools,” Aspect-Oriented Software Development, R.E. Filman, et al., eds., pp. 507-530, 2005.
[24] C. Zhang and H.-A. Jacobsen, “PRISM is Research In aSpect Mining,” OOPSLA Companion, J.M. Vlissides and D.C. Schmidt, eds., pp. 20-21, 2004.
[25] C. Zhang and H.A. Jacobsen, “Quantifying Aspects in Middleware Platforms,” Proc. Second Int'l Conf. Aspect-Oriented Software Development (AOSD '03), pp. 130-139, Mar. 2003.
[26] R. Ettinger and M. Verbaere, “Untangling: A Slice Extraction Refactoring,” Proc. Third Int'l Conf. Aspect-Oriented Software Development (AOSD '04), pp. 93-101, Mar. 2004.
[27] S. Breu and J. Krinke, “Aspect Mining Using Event Traces,” Proc. 19th IEEE Int'l Conf. Automated Software Eng. (ASE '04), pp. 310-315, Sept. 2004.
[28] D. Shepherd, E. Gibson, and L.L. Pollock, “Design and Evaluation of an Automated Aspect Mining Tool,” Proc. Int'l Conf. Software Eng. Research and Practice (SERP '04), pp. 601-607, June 2004.
[29] T. Tourwé and K. Mens, “Mining Aspectual Views Using Formal Concept Analysis,” Proc. Fourth Int'l Workshop Source Code Analysis and Manipulation (SCAM '04), pp. 97-106, Sept. 2004.
[30] M. Marin, A. van Deursen, and L. Moonen, “Identifying Aspects Using Fan-In Analysis,” Proc. 11th Working Conf. Reverse Eng. (WCRE '04), pp. 132-141, Nov. 2004.
[31] M. Ceccato, M. Marin, K. Mens, L. Moonen, P. Tonella, and T. Tourwé, “A Qualitative Analysis of Three Aspect Mining Techniques,” Proc. Int'l Workshop Program Comprehension (IWPC '05), May 2005.
[32] Y. Coady, G. Kiczales, M. Feeley, and G. Smolyn, “Using Aspect C to Improve the Modularity of Path-Specific Customization in Operating System Code,” Proc. Joint European Software Eng. Conf. (ESEC '01), pp. 88-98, June 2001.
[33] C. van Rijsbergen, Information Retrieval, second ed. London: Butterworths, 1979.
[34] “Project Bauhaus,” http:/, 2005.
[35] M. Bruntink, A. van Deursen, R. van Engelen, and T. Tourwé, “An Evaluation of Clone Detection Techniques for Identifying Crosscutting Concerns,” Proc. IEEE Int'l Conf. Software Maintenance (ICSM '04), pp. 200-209, Sept. 2004.
[36] R. Holt, “Structural Manipulations of Software Architecture Using Tarski Relational Algebra,” Proc. Fifth Working Conf. Reverse Eng. (WCRE '98), pp. 210-219, Oct. 1998.
[37] M. Bruntink, “Aspect Mining Using Clone Class Metrics,” CWI Technical Report SEN-E0502, Centrum voor Wiskunde en Informatica (Center for Math. and Computer Science), Amsterdam, Netherlands, Feb. 2005.
[38] M. Bruntink, A. van Deursen, and T. Tourwé, “Isolating Idiomatic Crosscutting Concerns,” Proc. IEEE Int'l Conf. Software Maintenance (ICSM '05), Sept. 2005.

Index Terms:
Index Terms- Clone detection, reverse engineering, aspect-oriented programming, crosscutting concerns, aspect mining.
Magiel Bruntink, Arie van Deursen, Remco van Engelen, Tom Tourw?, "On the Use of Clone Detection for Identifying Crosscutting Concern Code," IEEE Transactions on Software Engineering, vol. 31, no. 10, pp. 804-818, Oct. 2005, doi:10.1109/TSE.2005.114
Usage of this product signifies your acceptance of the Terms of Use.