PrevPrev UpUp NextNext


Detect Code Clones

A pathalogical and widely used way of re-use is to copy a piece of code to some other place and possibly modify it slightly there. This copy creates a code clone. The problem with code clones is that a fault in the original code must be fixed in all its copies, but normally it is not recorded where the code has been copied.

Empirical data show that system often have 20% and more code duplication.

To reduce the amount of code to be maintained and to find the places where faults must be fixed, the source code must be searched for code clones.

The Bauhaus toolkit lets you identify all code clones completely automatically. We distinguish three different kinds of clones:

type-I-clones
are copies that are identical
type-II-clones
are copies that are structurally identical, only identifiers were changed
type-III-clones
are copies where statements were added or removed
original sheep type-1 clone type-1 clone type-2 clone type-1 clone type-2 clone type-3 clone type-1 clone type-1 clone type-1 clone type-2 clone type-1 clone type-2 clone type-3 clone type-1 clone

Last modified: Tue Aug 26 11:52:41 MET DST 2003