On Software Maintenance Process Improvement
Based On Code Clone Analysis
Yoshiki Higo1 ,Yasushi Ueda1 ,Toshihro Kamiya2 ,Shinji Kusumoto1 and Katsuro Inoue1
1

Graduate School of Information Science and Technology, Osaka University,
Toyonaka, Osaka 560-8531, Japan
Phone:+81-6-6850-6571,Fax:+81-6-6850-6574{y-higo,y-ueda,kusumoto,inoue}@ist.osaka-u.ac.jp
2
PRESTO,Japan Science and Technology Corp.
Current Address:Graduate School of Information Science and Technology, Osaka
University,
Toyonaka, Osaka 560-8531, Japan
Phone:+81-6-6850-6571,Fax:+81-6-6850-6574
kamiya@ist.osaka-u.ac.jp

Abstract. Maintaining software systems is getting more complex anddifficult task. Code clone is one of the factors that make software maintenance more difficult. A code clone is a code portion in source files that is
identical or similar to another. If some faults are found in a code clone, itis necessary to correct the faults in its all code clones. We have developed
a maintenance support environment, Gemini, which provides the user
with the useful functions to analyze the code clones and modify them.
However, through case studies, several problems were reported. That is,the clones provided by Gemini were not appropriate to merge into one
module. In this paper, we intend to extend the functionality of Gemini
to cope with the problems. Finally, we apply the extended Gemini toseveral software and evaluate the applicability of the new functions.

1

Introduction

As the size and the complexity of software increase, it becomes important todevelop high-quality software cost-effectively within a specified period. Software
process improvement is one of the promising method to attain it.
Recently, it is pointed out that maintenance phase is the most expensive one
in the entire software development process. Many research studies have reported
that large software companies spent a lot of cost to maintaining the existing
systems. Maintenance of software system is defined as modification of a software product after delivery to correct faults, to improve performance or otherattributes, or to adapt the products to a modified environment[20].
Code clone is one of the factors that make software maintenance more difficult[8]. A code clone is a code portion in source files that is identical or similar toanother. Clones are introduced because of various reasons such as reusing codeby ‘copy-and-paste’ and so on. Code clones make the source files very hard tomodify consistently. For example, when a fault is found in one clone, it must be
carefully modified all the clones. So, effective code clone detection will support
the improvement of software maintenance process. In order to detect the code
clones effectively, various clone detection methods have been proposed.
We have developed a maintenance support environment, Gemini, which provides the user with the useful functions to analyze the code clones and modify
them[22]. CCFinder[13] is one of the components of Gemini and used to detect
code clones. Gemini primarily provides two diagrams: scatter plot and metrics
graph. The scatter plot graphically shows the locations of code clones amongsource codes. The metrics graph shows metric value of each clone and has afeature to identify the distinctive code clones. Using the diagrams, we expectedthat maintenance process can be improved.
We have delivered Gemini to several software companies and evaluated it
through case studies. In the case studies, we have received several practical problems. First one has been appeared in applying Gemini to refactoring activities[8].
Usually, code clones are merged into one module(procedure,function,macro etc).
The clones detected by Gemini were not appropriate to be merged, since it detects the maximal code clones that often include excessive tokens that shouldbe omitted in merging the clones into one routine. Second is one how to identify
the modified code portions as clone. As described above, code clone is introduced copy-and-paste programming. But, in most case, the copied-and-pasted
code portion is not used as it was. Usually, some statements are inserted to thecode portion or deleted from it. The practitioners in the company want to extract such modified code clones (called gapped clone) but Gemini cannot findthem.
In this paper, we intend to solve the above issues to extend the functionalityof Gemini. For the former issue, we have added the new function to extract thepart of code clone which is easy to merge one module. For the latter issue, we
propose a method to show all the candidates of gapped code clones. As spaces arelimited, we mainly explain the first topics. Finally, we apply Gemini to several
software and evaluate the applicability of the proposed method.

2

Code Clone Analysis

2.1

Definitions on code clone

A clone relation is defined as an equivalence relation (i.e., reflexive, transitive,
and symmetric relation) on code portions[13]. A clone relation holds between
two code portions if (and only if) they are the same sequences. (Sequences are
sometimes original character strings, strings without white spaces, sequences oftoken type, and transformed token sequences. ) For a given clone relation, apair of code portions is called clone pair if the clone relation holds between the
portions. An equivalence class of clone relation is called clone class. That is, aclone class is a maximal set of code portions in which a clone relation holds
between any pair of code portions.

C9D)EF,G.HI$%KJL$M
Source files
Software maintenance system/1032-4*57698 : ; 67<=(0>36(=; 03?36(/@3AB3634

Code clone detector+ ,( -.* 

The location of clone pairs

G ap detector

Code clone shaper

The location of g aps

The location of shaped clone pairs   !

I nterfaces m anag er#"!$%%&"'$()*

I nterfaces ( e. g . scater plot, m etrics g raph, . . . )U ser(a) Architecture(b) Code Clone Shaper

Fig. 1. Overview of Gemini

A code portion in a clone class of a program is called a code clone or simply
a clone.
2.2

Maintenance support environment: Gemini

In [21], we have developed a maintenance support environment based on code
clone analysis (called Gemini). Figure 1(a) shows the system architecture. In
Figure 1(a), the gray parts (a gray quadrilateral and ellipse) have been proposedin [22] and the black parts(, which is enlarged in Figure 1(b).) will be proposed
in Section 3 in this paper. Basically, Gemini delivers the source files to the code
clone detector, CCFinder[13], and then shows the information of the detectedcode clones to the user through various GUIs.
In this Section, we briefly explain the characteristic of CCFinder and Gemini.
Tool: CCFinder CCFinder detects code clones from programs and outputs
the locations of the clone pairs on the programs. The length of minimum clone
is set by user before.
Clone detection of CCFinder is a process in which the input is source files
and the output is clone pairs. The process consists of four steps:
Step1 Lexical analysis: Each line of source files is divided into tokens corresponding to a lexical rule of the programming language. The tokens of all
source files are concatenated into a single token sequence, so that finding
clones in multiple files is performed in the same way as single file analysis.

(a) scatter plot(b) corresponding code

Fig. 2. Gemini snap shots

Step2 Transformation: The token sequence is transformed, i.e., tokens are added,
removed, or changed based on the transformation rules that aims at regularization of identifiers and identification of structures. Then, each identifier
related to types, variables, and constants is replaced with a special token.
This replacement makes code portions with different variable names clone
pairs.
Step3 Match Detection: From all the sub-strings on the transformed token
sequence, equivalent pairs are detected as clone pairs.
Step4 Formatting: Each location of clone pair is converted into line numberson the original source files.
Details of CCFinder have been shown in [13].
Tool: Gemini Gemini is a GUI-based code clone analysis environment whichuses CCFinder as a code clone detector. Gemini provides to the users the following view windows that enable an interactive code clone analysis:– Scatter plot view,– Metric graph view, and– Source code view.
Scatter plot view shows visually where clone pairs exist in source files. It isvery effective mechanism in early phase of code clone analysis since the stateof distribution of code clone can be grasped at a glance. In the view,user canselect clone pairs by mouse dragging. Figure 2(a) shows an example of scatterplot view. The detail of scatter plot will be described later.
Metric graph view is designed for enabling the users to select clones by thequantitative characteristics of them. In metric graph view, user can select clone
pairs or classes by the values of metric for each clone class to easily select thedistinctive ones.

1

A

1

A

3

C

5

C

7

E

9

B

2
4
code fragment X

6
8

10

2

B

3

C

4

E

c o d e fra g m e n t Y
5 6 7 8
F

B

C D

9

E

10

B

11 12
C

D

B
D
D
F
C

11 D

12 G

A ,B ,C , ... : c h a r a c te r , to k e n , lin e , s ta te m e n t o r f u n c tio n , ... e tc .
: c o d e c lo n eFig. 3. Scatter plot of code clones

The source code view works cooperating the scatter plot view on the metricgraph view. The user can obtain the actual source code corresponding to clones
selected in the other views. Figure 2(b) shows an example of source code view.
Scatter plot Figure 3 shows examples of scatter plot. Both the vertical and horizontal axes represent code portions of source files. The following two sequences
are used as sample code portions in the scatter plot.
code portion X: “ABCDCDEFBCDG”,
code portion Y: “ABCEFBCDEBCD”
Here, symbols “A”,“B”,“C”,... are code portions in an unit such as character,token, line, statement, function, etc (In Gemini, it is token). In Figure 3, eachsmall black square means that corresponding two elements on the two axes are
the same. So, a clone pair is shown as a diagonal line segment. If the same code
portions are arranged on the two axes, naturally, a diagonal line from the upper
left to the lower right is drawn since such dot means comparison of token withitself, and the dots are symmetrical with a diagonal line.
The state of distribution of code clone can be grasped at a glance. However,as for large scale software in which there are many code clones, it is very difficult
to decide which plot (that is code clone) in the huge scatter plot should be kept
our eyes on. That is, if many files are located on the axis of coordinate in naive
order, such as alphabetical order with file name, the distribution of code clones
is occasionally spread widely without conspicuous deviation. So, Gemini has thefunction to sort the order of files on the two axes. It causes code clones not to
distribute all over a scatter plot as much as possible. As a basic idea, the moreIf (a > b ) { b + + ; a = 1 ; }resu
resu eded b b y y ‘c‘c o o p p y y -a-a ndp
nd-p a ste’a ste’
rena m ed

If (a > b ){// commentb + + ;
a = 1 ;}If (i > j){// comment
j+ + ;
i= 0 ;}Exact clone

R enam ed clone

inserteddel etedm o dif ied

If (i > j){
j= j/2 ;// comment
j+ + ;
i= 0 ;}If (i > j){// commenti= 0 ;}If (i > j){// commentj= j+ 1 ;i= 0 ;}

G ap p ed clones
gaps

Fig. 4. Gapped clone

code clones exist among two source files, the nearer the files are to be located ineach axis. The details is described in [21].

3Proposed Method

3.1

Problems found in case studies

We have applied Gemini (and CCFinder) to several commercial software products. In the case studies, the users reported some problems as feedback. Amongthem, the following two problems are repeatedly reported and serious ones.
As for the first one, in the case of ‘copy-and-paste’ reuse, the developers usually do not reuse the code portion as it was but partially modifies and then reuse
it. Moreover, in the modification, they do not only replace the user-defined identifiers in the code portion but also modify it. For example, additional statements
would be inserted into it. Thus, some differences exist between the original code
portion and the copied-and-pasted one. Here, we call the each difference “gap”
and such code clone as “gapped clone”. From a viewpoint of how to reuse code,
we classify code clone into five categories shown in Figure 4. Then, CCFinder
can only detect exact clones and renamed clones.
In such case, the developers can subjectively identify the code clones even
if they include some gaps among them. On the other hand, CCFinder detects
the clone as several short code clones separately. Or, since the minimum lengthof a code clone must be set in CCFinder beforehand, if the code portion is too
short, CCFinder does not identify it as a code clone. Conversely, if we set asmall value to the minimum length, then a lot of code clones are detected andthe information is practically useless.

  M* %
 NB! 2 $*& ' 2 (O+& ' 2 , , . ////%< / =
< // 12 3 4 56< 78 /$D
= ! / 9 ;:@)
2 / 9 - > 13 3  ) ! 9 2 ?7  ! 2 9 - - '/ 12 3 $D! 2 9 - 12 3 4 56 78 '/ 12 3 4 52 $ 2 '/<%<'12 3 4 5678 $ICNE
GPD a b@c d eFfKgh+eFijehe+kklmn op qnn nzp nM{ o+q qp}zp nn op q r s+tzuv p nfK{ d n w op c q xy nw l |b@yd w u ba d w l l hn op q fKd w l r s+tuv hn op q r s e~fjen hz@zhr s+tuv fQSRNTAUVWRXYMZ RF[0\           
  "! #%$ & '#(*) '+# , ,.0////%< / =
< // 12 3 4 56< 7+8 / $*= ! / 9 ;:)2 / 9 - > 13 3  )! 9 2 ?@7  ! 2 9 - - '/ 12 3 $*! 2 9 - 12 3 4 567+8 '/ 12 3 4 5 #$A#B' /<%<'12 3 4 567+8 $DCFEG  IHKJFL L %DINBNQ]RFTKU^VWR%XYZ RF[`_

Fig. 5. Example of merging two code portions

In [22], we proposed the solution of this problem. In the paper, we could
refer to a certain set of gapped clones by representing visually exact/renamed
clones and gaps themselves on scatter plot. In fact, the complexity of detecting
all gapped clones one by one is massive (square of number of exact/renamed
clones). So, we took the alternative solution.
Next, as for the second problem, if we detect code clones for refactoring[8],sometimes semantically cohesive ones has more important meaning than maximal (just longest in local) ones although the formers may be shorter than thelatters. In our experiments, we found many clones that have not only primary
logic statements but also the other coincidental clone statements before (and/or
behind) them, since simple statements, such as assignment or variable declaration, tend to become clones coincidentally. Figure 5 shows an example. In Figure
5, there are two code portions A and B from a program, and the code portions
with hatching are maximal clones among them. In code portion A, some data
are substituted to list data structure from the head successively. In code portion
B, they are done so from the tail successively. There is a common logic between
these two processes that is code portions handling list data structure (in forblock). However before and behind for block there are sentences that are identified as a part of code clones coincidentally. It can be said that such blocks
without coincidental portions are preferred to whole portions with hatching in
the figure in the view point of refactoring.
In [14] and [15], they detect semantically cohesive code clones using program dependence graph (PDG) for the purpose of procedure extraction and soon. However, currently, there are no examples of the application of their approaches to large scale softwares since the cost to create PDG is very high. On
the other hand, the clone detection process of CCFinder is very fast but only

lexical analysis is performed. So, the detected clones are just maximal and notalways semantically cohesive. Hence it is necessary for the user of CCFinder toextract semantically cohesive portions manually from the maximal.
To solve this problem, we take a two-step approach in which we firstly detectmaximal clones and secondly extract semantically cohesive ones from the results.
By this approach, in practical time, we can detect code clones that are easy to
be reused. The details are explained in next section.
3.2

Approach

Here, we define Shaped Clone as the merge-oriented code clone extracted fromthe clones detected by CCFinder. We explain the way how to extract the Shaped
Clone. The extracting process consists of the following three steps:
STEP1: CCFinder is performed and clone pairs are detected.
STEP2: By parsing the inputted source files and investigating the positions ofblocks, semantic information (body of method, loop and so on) is given toeach block.
STEP3: Using the information of location of clone pairs and semantics of blocks,
meaningful blocks in the code clone are extracted. Here, intuitively, meaningful block indicates the part of code clone that is easy to merge.
3.3

Implementation

We have implemented the shaped clone detection function(Code Clone Shaper
in Figure 1(a)) in Gemini. The size of the function is about 10KLOC and implemented in Java. The target source files are also Java programs.
We explain the implementation of the proposed shaped clone detection method.
The implementation includes the following units shown in Figure 1(b):– Control unit
– Parsing unit
– Block extraction unit
– Block management unit
Control unit Control unit invokes the Parsing unit, Block extraction unit, andBlock management unit through reading the code clone information (output
from CCFinder).
Parsing unit Parsing unit conducts lexical and syntax analysis for the inputtedsource files. Here, we define Block as code portion enclosed by a pair of brackets.
So we use only the result of lexical analysis in this paper and the information
about syntax will be taken into the consideration in our future research. Then,the location information of the extracted token is stored. It is implemented using
JavaCC[11].

Block extraction unit Block extraction unit extracts the block from the code
clones detected by CCFinder using the stored data and analysis results from
CCFinder.
Block management unit Block management unit puts the blocks extracted
by Block extraction unit in an appropriate order. It is necessary to obtain theconsistency of the data used in Gemini.

4

Case Study

In order to evaluate the usefulness of the proposed shaped clone detection
method, we have applied it to famous Java software:ANTLR[2] and Ant[1].
ANTLR(ANother Tool for Language Recognition,) is a language tool thatprovides a framework for constructing recognizers, compilers, and translatorsfrom grammatical descriptions containing C++ or Java actions.
Ant is another Java based build tool. Instead of a model where Ant is extended with shell based commands, it is extended using Java classes. Insteadof writing shell commands, the configuration files are XML based calling out atarget tree where various tasks get executed. Each task is run by an object which
implements a particular task interface.
In the evaluation, we have applied Gemini without using Code Clone Shaper
and Gemini with it to the data, independently. Then, we compare the results.
In this case study, we have set the minimum length of a code clone as 50 tokens.
Table 1. Source code size

ANTLR
Ant

4.1

Number of files Lines of code Number of tokens
239
43548
140802508
141254221203ANTLR

ANTLR includes 239 files and the size is about 44KLOC(see in Table 1). Figure6(a) shows the results of applying the Gemini without Code Clone Shaper. You
can see that there are a lot of clones in ANTLR. Here, we can find 338574 clone
pairs and 1072 clone classes. So, it is very difficult to extract the clones that canbe merged into one module.
On the other hand, Figure 6(b) shows the results of applying the Geminiwith Code Clone Shaper. You can see that non-meaningful clones are omitted.
Here, we can find 972 clone pairs and 142 clone classes. The reduction rate of thenumber of clone pairs and clone classes are about 1/350 and 1/8, respectively(seein Figure 6(c)).

(a) Result without Code Clone Shaper

Number of Clone Pair
Number of Clone Class(b) Result with Code Clone Shaper

without Code Clone Shaper with Code Clone Shaper
338574972
1072
142(c) Numbers of clone

Fig. 6. Result of ANTLR analysis

Then, we checked the part labeled A in Figure 6(b) and found distinctivecode clones. There are 28 clones and each of them include 82 tokens. We caneasily merge the clones to one method by adding two parameters shown in Figure
7. Code portions on the left side are clones provided by Gemini with Code Clone
Shaper. If they are merge into one method,it will be like the code portion on theright side.
4.2

Ant

Next, we applied Gemini to Ant. Ant includes 508 files and the size is 141KLOC(seein Table 1). Figure 8(a) shows the results of applying the Gemini without CodeClone Shaper. You can see that code clones spread over the scatter plot. Here,
12033 clone pairs and 856 clone classes were detected. On the other hand, Figure8(b) shows the results of applying the Gemini with Code Clone Shaper. Here,103 clone pairs and 53 clone classes were detected .
You can see that most of the clones are omitted and the part labeled B stands
out. Figure 8(d) shows the actual code clones of it. We found seven separate         0   %%  ! $ ( # )*+ "  ,  $  %-  " $  . %( #  $ # " /-  " $ 
 $  $ $ 3 " 4
% & "  $ & " 5    4
 $   " ,  5 $ " - $ 6  " , $ ( ! ' 4$ $ 3 "50 0     /4
 $  * " "- 4

 "   # " $ " % & " '. % & "  $ # " 0%-  " $  21

B $  ( ! 8 M8 ' 4 !   # " $ " % & " ::; $ & " 55   :0:G $ $ 3 " < 5  & " 6  = L'%1
 $ & " 5 & "  & " !  $ $ 3 " ' 4 $ & " 6 * " $ " - $ ! " )> $ #  , ! $ " - $ 6 , " $ ?%   " # ! ' .   " ,  . $ " - $ 6  " , $ ( ! ' A   " ,  ' ' 4
B # " $  # % & " 5 $ & " 4                !   "   # " $ " % & " '$ ( # )*+ "  ,  $  %-  " $  . %( #  $ # " /-  " $  . % & "  $ # " 0%-  " $  21
 $  $ $ 3 " 4
% & "  $ & " 5    4
 $   " ,  5 $ " - $ 6  " , $ ( ! ' 4
 $ $ 3 "%52   7 /   /4
 $  * " "- 4B $  ( ! 8 98 ' 4 !   # " $ " % & " ::; $ & " 55   :0:  $ $ 3 " < 5  & " 6  = 2'%1
 $ & " 5 & "  & " !  $ $ 3 " ' 4 $ & " 6 * " $ " - $ ! " )> $ #  , ! $ " - $ 6 , " $ ?%   " # ! ' .   " ,  .@" - $ 6  " , $ ( ! ' A   " ,  ' ' 4
B # " $  # % & " 5 $ & " 4        ;+ CD  %E0%D!   "   # " $ " % & " .  $ .  ( # '$ ( # )*+"  ,  $  -  " $  . ( #  $ # " /-  " $  .  & "  $ # " 0-  " $  21
 $  $ $ 3 " 4
% & "  $ & " 5    4
 $   " ,  5 $ " - $ 6  " , $ ( ! ' 4
 $ $ 3 "5/ 4
 $  * " "- 4

I
I

I
B

 $  ( !  ' 4
 !   # " $ " % & " :0:F $ & " 55   :0:G $ $ 3 " < 5  & " 6  = 2'%1
 $ & " 5 & " % & " !  $ $ 3 " ' 4 $ & " 6 * " $ " - $ ! " )H $ #  , ! $ " - $ 6 , " $ ?   " # ! ' .   " ,  . $ " - $ 6  " , $ ( ! ' A   " ,  ' ' 4
B # " $  # % & " 5 $ & " 4

I
I
I
I
I
I
I
I
I
        0+%J0+%K!   "  # " $ " % & " '$ ( # )*+ "  ,  $  %-  " $  . %( #  $ # " /-  " $  . % & "  $ # " 0%-  " $  21
 $  $ $ 3 " 4
% & "  $ & " 5    4  $   " ,  5 $ " - $ 6  " , $ ( ! ' 4
 $ $ 3 "%5/+ J0+K 4
 $  * " "- 4B $  ( ! 8 B 8 ' 4 !   # " $ " % & " ::; $ & " 55   :0:G $ $ 3 " < 5  & " 6  = L'%1
 $ & " 5 & "  & " !  $ $ 3 " ' 4 $ & " 6 * " $ " - $ ! " )> $ #  , ! $ " - $ 6 , " $ ?%   " # ! ' .   " ,  . $ " - $ 6  " , $ ( ! ' A   " ,  ' ' 4
B # " $  # % & " 5 $ & " 4

Fig. 7. Merged clone sample in ANTLR

(a) Result without Code Clone Shaper

Number of Clone Pair
Number of Clone Class(b) Result with Code Clone Shaper

without Code Clone Shaper with Code Clone Shaper
12033
103
856
53
(c) Numbers of clone         !! "#  $!%&' ()!+* , #-+#$../  &'
!%0  "  1!2# 3&40  5+"# 1687:9;*8<#=#> -@?A;BC>EDA;?*+F@?+6&4G
H 8 I ()!C*8 -C80 JK" L 8  " M N MO&3&'!%0  "  1!2# 3&40  5+"# 1687:9;*8<#=#> -@?A;BC>EDA;?*N2?;AC&4G
H 8 I ()!C*8 -C80 JK" L 8  " MPDCM1&3&'!%0  "  1!2# 3&40  5+"# 1687:9;*8<#=#> -@?A;BC>EDA;?*:DC>%&4G
H 8 E'
!%0  "  1!2# 3&40  5+"# 1687:9;*8<#=#> -@?A;BC>EDA;?*+F@?+6&4G
HQ Q R( H(d) Entirely same clone in Ant

Fig. 8. Result of Ant analysis

methods in the several files. Since the methods inherit the same super class, we
can remove the clones easily by moving the method to the super class.
Also, the reduction rate of the number of clone pairs and clone classes areabout 1/120 and 1/16, respectively(see in Figure 8(c)).

5Conclusion

In this paper, we have extended the functionality of a maintenance support
environment Gemini to easily merge code clones into one code portion. We haveapplied Gemini with Code Clone Shaper to two practical Java software ANTLR
and Ant. By using Code Clone Shaper, we can dramatically reduce the number ofclone pairs and clone classes. The clones removed by Code Clone Shaper has no
meaningful block (not including the pair of brackets) and are difficult to merge
as one method. Moreover, as shown in Figures 7 and 8(d), the selected clones
are easy to merge into one code portion. So, we consider that Gemini achieves
the evolution to support the maintenance activity more efficiently.
Of course, we have to continue applying Gemini to actual software maintenance process and improving/refining the functionality.

References
1. Ant, http://jakarta.apache.org/ant/, 2002.
2. ANTLR, http://www.antlr.org/, 2000.
3. B. S. Baker, A Program for Identifying Duplicated Code, Computing Science andStatistics, 24:49-57, 1992.
4. B. S. Baker, On Finding Duplication and Near-Duplication in Large Software Systems, IN Proc. IEEE Working Conf. on Reverse Engineering, pages 86-95, July
1995.
5. B. S. Baker, Parameterized Duplication in Strings: Algorithms and an Application
to Software Maintenance, SIAM Journal on Computing, 26(5):1343-1362, 1997.
6. I. D. Baxter, A. Yahin, L. Moura, M. Sant’Anna, and L. Bier, Clone Detection Using
Abstract Syntax Trees, Proc. IEEE Int’l Conf. on Software Maintenance (ICSM) ’98,
pages 368-377, Bethesda, Maryland, Nov. 1998.
7. S. Ducasse, M. Rieger, and S. Demeyer, A Language Independent Approach for Detecting Duplicated Code, Proc. of IEEE Int’l Conf. on Software Maintenance(ICSM)’99, pages 109-118, Oxford, England, Aug. 1999.
8. M. Fowler, Refactoring: improving the design of existing code, Addison Wesley,1999.
9. D. Gusfield, Algorithms on Strings, Trees, And Sequences, Cambridge University
Press, 1997.
10. J. Helfman, Dotplot Patterns: a Literal Look at Pattern Languages, TAPOS,
2(1):31-1,1995.
11. JavaCC, http://www.webgain.com/products/java_cc/, 2000.
12. J. H. Johnson, Identifying Redundancy in Source Code using Fingerprints, Proc.
of CASCON ’93, pages 171-183, Toronto, Ontario, 1993.
13. T. Kamiya, S. Kusumoto, and K. Inoue, CCFinder: A multi-linguistic tokenbased code clone detection system for large scale source code IEEE Transactions on
Software Engineering, 28(7):654-670, 2002.

14. R. Komondoor and S. Horwitz, Using slicing to identify duplication in source code,
In Proc. of the 8th International Symposium on Static Analysis, Paris, France, July
16-18, 2001.
15. Jens Krinke, Identifying Similar Code with Program Dependence Graphs , In Proc.
of the 8th Working Conference on Reverse Engineering, 2001.
16. J. Mayland, C. Leblanc, and E. M. Merlo Experiment on the Automatic Detectionof Function Clones in a Software System Using Metrics, Proc. of IEEE Int’l Conf.
on Software Maintenance (ICSM) ’96, pages 244-253, Monterey, California, Nov.
1996.
17. L. Prechelt, G. Malpohl, M. Philippsen, Finding plagiarisms among a set of programs with JPlag, submitted to Journal of Universal Computer Science, Nov. 2001,
taken from http://wwwipd.ira.uka.de/~prechelt/Biblio/
18. M. Rieger, S. Ducasse, Visual Detection of Duplicated Code, 1998.
19. Duploc, http://www.iam.unibe.ch/~rieger/duploc/, 1999.
20. Pigoski T. M, Maintenance, Encyclopedia of Software Engineering, 1, John Wiley& Sons, 1994.
21. Y. Ueda, T. Kamiya, S. Kusumoto, K. Inoue, Gemini: Maintenance Support Environment Based on Code Clone Analysis, 8th International Symposium on Software
Metrics, pages 67-76, June 4-7, 2002.
22. Y. Ueda, T. Kamiya, S. Kusumoto, K. Inoue, On Detection of Gapped Code Clones
using Gap Locations, 9th Asia-Pacific Software Engineering Conference, 2002, (toappear).
23. S. W. L. Yip and T. Lam, A software maintenance survey, Proc. of APSEC ’94,
pages 70-79, 1994.