Title コードクローン検出法 Author(s) 井上, 克郎 ; 神谷, 年洋 ; 楠本, 真二 Citation コンピュータソフトウェア. 18(5) P.529-P.536 Issue Date 2001 Text Version publisher URL http://hdl.handle.net/11094/51608 DOI 10.11309/jssst.18.529 rights
(529) 47 1 (code clone) [5] 20 ( 100 2000 ) [14] [8] Code-Clone Detection Methods. Katsuro Inoue,, Graduate School of Engineering Science, Osaka University. Toshihiro Kamiya, 21, PRESTO, Japan Science and Technology Corporation. Shinji Kusumoto,, Graduate School of Engineering Science, Osaka University, Vol.18, No.5(2001), pp.47 54. [] 2001 5 31. 1 2 : : [1] [2] [3] [4] [5] [7] [10] [11] [12] [13]
48 (530) : : : : 2 [11] 3 4 5 2 2 α β C(α, β) α β α β C α α α β C(α, β) α β (α < α, β < β ) C(α,β ) α β (α < α β < β ) C(α,β ) C(α, β) α β α β α α S S α β( α =β) (pattern matching problem [9]) (local alignment problem [9]) S P 2 S 1 S 2 t 1 t 2 1 1 1 HTML XML DNA
(531) Vol. 18 No. 5 Sep. 2001 49 341: dwframegrouplength = 1; 342: for(dwcnt = 2; dwcnt <= 64; dwcnt *= 2) 343: { 344: if(((uloutrate / dwcnt) * dwcnt)!= 345: uloutrate) 346: { 347: dwframegrouplength *= 2; 348: } 349: } 784: framegrouplength = 1; 785: for (cnt = 2; cnt <= 64; cnt *= 2) { 786: if (((rate / cnt) * cnt)!= rate) 787: framegrouplength *= 2; 788: } 1 3 3.1 (token) [11] 1 (parameterize) 1 dwcnt cnt if ( ) [7]
50 (532) [1] (statement) 1 [15] 1 [3] [6] () 2 (scatter plot) n O(n 2 ) (suffix tree) S [9] S =(s 1s 2s 3...s N ) (1...N) 1 2 () 2 ( ) O(n) [9] k () O(n + k) 3.2 () { } 4 Dup [1] [2] Baker 1992 C
(533) Vol. 18 No. 5 Sep. 2001 51 2 O(n) Duploc [7] Ducasse 1999 O(n 2 ) Duploc () (C compound block {}) Duploc GUI(graphical user interface) Ducasse CDIF [16] MOOSE CloneDR [5] Baxter 1998 C COBOL AST(abstract syntax tree) AST O(n 2 ) (1)2 2 (2)C CloneDR C COBOL SMC [3] [4] Merlo 1999
52 (534) 1 (, (, { }, ) CPU, ) Dup, 1.1MSLOC [1] [2] O(n) R3000 40MHz, 256MB RAM, {C} 7 Duploc 460KSLOC [7] O(n 2 ) G3 230MHz, 100MB RAM, {C, COBOL, Python, 6.5 Smalltalk} CCFinder,, 10MSLOC [11] O(n) PIII 650MHz, 1GB RAM, {C, C++, Java, COBOL} 68 CloneDR AST, 100KSLOC, [5] () (), 600MB RAM, {C, COBOL, Java} O(n 2 ) 2 SMC 215KSLOC, [3] [4] Pentium-Pro 180MHz, {Java} O(n) 64MB RAM, () 2 O(n 2 ) O(n) 18 ( ) CCFinder [11] 2000 O(n) ( ) 1 ( ) 5 (1) [8] (2) (3) 3 5.1 [8] ( ) 4
(535) Vol. 18 No. 5 Sep. 2001 53 3 CloneDR SMC () 5.2 5.3 COBOL [14] ( noclone-sloc) noclone-sloc SLOC 3 1
54 (536) Baker [1] 30 Ducasse [7] 10 30 10 C 3 OS 10 OS () 6 (METRICS (International Symposium on Software Metrics) ICSM (International Conference on Software Maintenance) ) (JSME (Journal of Software Maintenance and Evolution) ) [ 1 ] Baker, B. S. : A Program for Identifying Duplicated Code, Proc. of Computing Science and Statistics: 24th Symposium on the Interface, 24, pp. 49 57, Mar. 1992. [ 2 ] Baker, B. S. : On finding Duplication and Near- Duplication in Large Software System, Proc. of the Second IEEE Working Conf. on Reverse Eng., pp. 86 95, Jul. 1995. [ 3 ] Balazinska, M., Merlo, E., Dagenais, M., Lague, B. and Kontogiannis, K. A. : Measuring Clone Based Reengineering Opportunities, Proc. of the 6th IEEE Int l Symposium on Software Metrics (MET- RICS 99), pp. 292 303, Boca Raton, Florida, Nov. 1999. [ 4 ] Balazinska, M., Merlo, E., Dagenais, M., Lague, B. and Kontogiannis, K. A. : Partial Redesign of Java Software Systems Based on Clone Analysis, Proc. of the 6th IEEE Working Conf. on Reverse Eng. (WCRE 99), pp. 326-336, Atlanta, Georgia, Oct. 1999. [ 5 ] Baxter, I. D., Yahin, A., Moura, L., Sant Anna, M. and Bier, L. : Clone Detection Using Abstract Syntax Trees, Proc. of IEEE Int l Conf. on Software Maintenance (ICSM 98), pp. 368 377, Bethesda, Maryland, Nov. 1998. [ 6 ] Burd, E. and Munro, M. : Evaluating the Evolution of a C Application, Proc. of ACM SIGSOFT Int l Workshop on Principles of Software Evolution (IWPSE 99), pp. 1 5, Fukuoka, Japan. July 1999. [ 7 ] Ducasse, S., Rieger, M. and Demeyer, S. : A Language Independent Approach for Detecting Duplicated Code, Proc. IEEE Int l Conf. on Software Maintenance (ICSM 99), pp. 109 118, Oxford, England, Aug. 1999. [ 8 ] Fowler, M. : Refactoring: Improving the Design of Existing Code, Addison-Wesley (2000) (: :, (2000)). [ 9 ] Gusfield, D. : Algorithms on Strings, Trees, and Sequences, pp. 89 180, Cambridge University Press, 1997. [10] Johnson, J. H. : Identifying Redundancy in Source Code Using Fingerprints, Proc. of IBM Centre for Advanced Studies Conference (CASCON 93), pp. 171 183, Toronto, Ontario, Oct. 1993. [11] Kamiya, T., Kusumoto, S. and Inoue, K. : A Code Clone Detection Technique for Object- Oriented Programming Languages and Its Emprical Evaluation, Proc. of the 62nd National Convention of IPSJ, pp. 23 28, 2001. [12] Kontogiannis, K. A., Mori, R. D., Merlo, E., Galler, M. and Bernstein, M. : Pattern Matching Techniques for Clone Detection and Concept Detection, Journal of Automated Software Engineering, Kluwer Academic Publishers, Vol. 3, pp. 770 108, 1996. [13] Mayland, J., Leblanc, C. and Merlo, E. M. : Experiment on the Automatic Detection of Function Clones in a Software System Using Metrics, Proc. of IEEE Int l Conf. on Software Maintenance (ICSM 96), pp. 244 253, Monterey, California, Nov. 1996. [14],,,,, :, SS200-49, Vol. 100, No. 570, pp. 57 64, 2001. [15] Prechelt, L., Malpohl, G. and Phlippsen, M. : JPlag: Finding plagiarisms among a set of programs, Technical Report, Fakultat fur Informatik Universitat Karlsruhe, 2001, http://wwwipd.ira.uka. de/prechelt/biblio/jplagtr.pdf [16] The CDIF Standards on the Web, http://www.eigroup.org/cdif/online.html