An Approach to Retrieving Similar Source Codes by Control Structure and Method Identifiers
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.
KeywordsDerived structure retrieval model Control statement Method identifier Vector space retrieval model
Unable to display preview. Download preview PDF.
- 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
- 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.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.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
- 7.Struts - The Apache Software Foundation (2012), http://struts.apache.org/