代码克隆类型
Four Clone Types
Type I
In Type I clones, a copied code fragment is the same as the original. These code clones are identical code clones with some modification in white space and comments.
Type II
A Type II clone is a code fragment that is the same as the original except for some possible variations about the corresponding names of user-defined identifiers (name of variables, constants, class, methods and so on), types, layout and comments.
Type III
Syntactically similar fragments that differ at the statement level. The fragments have statements added, modified, or removed with respect to each other.
Type IV
Syntactically dissimilar fragments that implement the same functionality. Type I, II, and III clones indicate textual similarity whereas Type IV clones indicate functional similarity.
1. Type-1: Identical code fragments differing by whitespace, comments
2. Type-2: Identical code fragments differing by identifier names or literal values
3. Type-3: Code fragments that have statements added, modified, or removed
4. Type-4: Code fragments that semantically perform the same computation with little syntactic similarity.