Efficient Algorithm for Detecting Parameterized Multiple Clones in a Large Software System
Two code fragments are said to be similar if they are similar in their program text or in their functionalities. The first kind of similarity can be detected with the help of parameterized string matching. In this type of matching, a given pattern P is said to match with a sub-string t of the text T, if there exists a bijection between the symbols of P and the symbols of t. The parameterized string matching problem has been efficiently solved by Fredriksson and Mozgovoy by using the shift-or (PSO) algorithm. The drawback of this algorithm is: it is unable to handle patterns of length greater than the word length (w) of a computer. In this paper, we solve this word length problem in a bit-parallel parameterized matching by extending the BLIM algorithm of exact string matching. Extended algorithm is also suitable for searching multiple patterns simultaneously. Experimentally, it has been observed that our algorithm is comparable with PSO for pattern length ≤ w and has ability to handle longer patterns efficiently.
KeywordsParameterized string matching bit-parallelism BLIM software maintenance clone detection and multiple patterns
Unable to display preview. Download preview PDF.
- 1.Roy, C.K., Cordy, J.R.: A survey on clone detection research. Technical Report No. 2007-541, School of Computing, Queen’s University at Kingston, Ontario, Canada (2007)Google Scholar
- 4.Baker, B.S.: Parameterized diff. In: 10th Symposium on Discrete Algorithm (SODA), pp. 854–855 (1999)Google Scholar
- 8.Prasad, R., Agarwal, S.: A new parameterized string matching algorithm by combining bit-parallelism and suffix automata. In: 8th IEEE International Conference on Computer and Information Technology, Sydney, Australia, pp. 778–783. IEEE Press, Los Alamitos (2008)Google Scholar
- 15.Navarro, G., Raffinot, M.: Fast and Flexible String Matching by Combining Bit-parallelism and Suffix automata. ACM Journal of Experimental Algorithms 5(4) (2000)Google Scholar