An Approach to Retrieving Similar Source Codes by Control Structure and Method Identifiers

  • Yoshihisa Udagawa
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7808)


In this paper, we present an approach to improve source code retrieval using the structure of control statements. We develop a lexical parser that extracts structural information for each method including control statements and method identifiers. We present a source code retrieval model, named “derived structure retrieval model,” in which a retrieval conditions are defined as a sequence of control statements and/or method identifiers, and meaningful search conditions are derived from the given sequence. Experiments on the source code of Struts 2 Core show that the derived structure retrieval model outperforms the vector space retrieval model.


Derived structure retrieval model Control statement Method identifier Vector space retrieval model 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Baxter, I.D., Yahin, A., Moura, L., Sant’Anna, M., Bier, L.: Clone detection using abstract syntax trees. In: Proc. of the 14th International Conference on Software Maintenance, pp. 368–377 (November 1998)Google Scholar
  2. 2.
    Kamiya, T., Kusumoto, S., Inoue, K.: CCFinder: A multi-linguistic tokenbased code clone detection system for large scale source code. IEEE Transactions on Software Engineering 28(7), 654–670 (2002)CrossRefGoogle Scholar
  3. 3.
    Marcus, A., Maletic, J.: Identification of high-level concept clones in source code. In: Proc. of the 16th International Conference on Automated Software Engineering, pp. 107–114 (November 2001)Google Scholar
  4. 4.
    Mayland, J., Leblanc, C., Merlo, E.M.: Experiment on the automatic detection of function clones in a software system using metrics. In: Proc. of the 12th International Conference on Software Maintenance, pp. 244–253 (November 1996)Google Scholar
  5. 5.
    Ouddan, A.M., Essafi, H.: A Multilanguage Source Code Retrieval System Using Structural-Semantic Fingerprints. International Journal of Computer and Information Science and Engineering, 96–101 (Spring 2007)Google Scholar
  6. 6.
    Salton, G., Buckley, C.: Term-Weighting approaches in automatic text retrieval. Information Processing and Management 24(5), 513–523 (1988)CrossRefGoogle Scholar
  7. 7.
    Struts - The Apache Software Foundation (2012),

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  • Yoshihisa Udagawa
    • 1
  1. 1.Faculty of EngineeringTokyo Polytechnic UniversityAtsugi-cityJapan

Personalised recommendations