Information Technology Reference
In-Depth Information
Algorithm 2. Clone Generation Algorithm
Require: function : Target function/method of the analyzed system to clone;
Require: type : Type of the clone to generate;
Ensure: The artificially generated clone of the input function.
1: function Clone( function , type )
# This mutation operation holds for every Type of clones
2: clone CopyAndChangeLayout( function )
3: if type 2 then
# This mutation operation is also applicable to Type 3 and Type 4 clones
4: SubstituteIdsAndLiterals( clone )
5: end if
6: if type =3 then
7: AddOrDeleteStatements( clone )
8: else if type =4 then
9: ReorderStatements( clone )
10: SubstituteEquivalentControlStructures( clone )
11: end if
12: return clone
13: end function
5.1 Dataset
The considered target system is an academic application implemented in Java
and developed by a Master student in Computer Science at the University of
Naples “Federico II”. As first step, the system has been manually analyzed to
remove the clones introduced during implementation. Afterwards, we applied
to this cleaned code the clone detector system we developed accordingly to the
description in [9]. This is to verify whether it detected either any false clone or
actual clones which had escaped the manual search. We then applied the clone
generator on this system, limiting the generation of clones to Type 3, to make
results comparable with ones reported in [9].
5.2 Research Questions and Variables
We assessed in this investigations the three following research questions:
RQ1 : Are the clones identified by the approach correct?
RQ2 : Is the group of clones identified by the approach complete?
RQ3 : Does the group of clones identified by the approach comply a good com-
promise between correctness and completeness?
Note that the definition of the third research question is motivated by the
fact that the completeness requirement is opposite to the correctness one, as
the former suggests outputting a large number of candidate clones, while the
latter implies a more conservative approach, where only quite likely clones are
detected.
 
Search WWH ::




Custom Search