Vol.2013-SE-179 No.15
2013/3/11

৘ใॲཧֶձ‫ڀݚ‬ใࠂ
IPSJ SIG Technical ReportίʔυΫϩʔϯʹ‫·ؚ‬ΕΔϝιου‫ͼݺ‬ग़͠ͷมߋ౓߹ͷௐࠪ޻౻ ྑհ1,a)ҏୡ ߒయ1,b)ੴඌ ོ1,c)Ҫ্ ࠀ࿠1,d)֓ཁɿίʔυΫϩʔϯͱ͸ɼ‫ͨ͠ࣅྨʹ͍ޓ‬ίʔυยͷ૊͋Δ͍͸ίʔυยͷू߹ͷ͜ͱͰ͋ΔɽίʔυΫϩʔϯͷ‫ݕ‬ग़ख๏΍ར༻ํ๏ʹ͍ͭͯ͸༷ʑͳ‫͞ͳ͕ڀݚ‬Ε͍ͯΔ͕ɼίʔυΫϩʔϯͱͳ͍ͬͯΔίʔυยࣗମ͕ͲͷΑ͏ͳιʔείʔυͰ͋Δͷ͔͸໌Β͔ͱͳ͍ͬͯͳ͍ɽຊ‫Ͱڀݚ‬͸ɼίʔυΫϩʔϯ‫ݕ‬ग़πʔϧͷ 1 ͭͰ͋Δ CCFinder ͕‫ݕ‬ग़͢ΔίʔυΫϩʔϯΛର৅ͱͯ͠ɼͦͷதʹ‫·ؚ‬ΕΔϝιο
υ‫ͼݺ‬ग़͠ʹண໨ͨ͠෼ੳΛߦͬͨɽͦͷ݁Ռɼίʔυย͝ͱʹଟগͷࠩҟ͕‫·ؚ‬ΕΔ͜ͱ͸͋Δ͕ɼϝιουͷதʹ͋Δʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯͷ‫ه‬ड़͸ಉҰͰ͋Δ͜ͱ͕ଟ͍͜ͱ͔Βɼྨࣅͨ͠ॲཧΛ࣮૷ͨ͠ίʔυย͕ίʔυΫϩʔϯͱͯ͠‫ݕ‬ग़͞Ε͍ͯΔ͜ͱΛ֬ೝͨ͠ɽ
ΩʔϫʔυɿίʔυΫϩʔϯ, CCFinder, Java, ϝιου‫ͼݺ‬ग़͠

An Empirical Study on Method Call Diﬀerences among Code Clones
Ryosuke Kudo1,a)Hironori Date1,b)

Takashi Ishio1,c)Katsuro Inoue1,d)Abstract: A code clone is a code fragment that has identical or similar portion in source code. Whilevarious code clone detection tools and their applications have been reported, source code characteristics ofcode clones in detail are not investigated. In this research, we have analyzed method calls involved in code
clones which are detected by CCFinder. As a result, code clones often involve the same “important method
calls” that likely implement a similar functionality in diﬀerent source code locations.
Keywords: Code clones, CCFinder, Java, Method calls

1. ͸͡Ίʹ

ίʔυΫϩʔϯͷ‫ݕ‬ग़ख๏͸ͦΕͧΕࣈ۟‫ྻܥ‬΍ߏจ໦ͳͲͷ༷ʑͳιʔείʔυͷಛ௃ʹண໨͓ͯ͠Γɼͨͱ͑ίʔυΫϩʔϯͱ͸ɼ‫ͨ͠ࣅྨʹ͍ޓ‬ίʔυยͷ૊͋Δ

͹ CCFinder[1] ͷ৔߹͸ɼιʔείʔυΛτʔΫϯྻͱ͍͠͸ίʔυยͷू߹ͷ͜ͱͰ͋Γɼଟ͘ͷ։ൃऀʹͱͬͯͯɼม਺໊΍ϝιου໊ͷҧ͍ɼۭനͷҧ͍Λແࢹͯ͠ൺֱ

ίʔυΫϩʔϯ͸ιϑτ΢ΣΞอकʹ໰୊Λ΋ͨΒ͢Մ͠ɼ͋Δᮢ஋ΑΓ΋௕͘Ұகͨ͠τʔΫϯྻͷൣғΛίʔೳੑ͕͋Δͱೝࣝ͞Ε͍ͯΔɽͦͷͨΊɼιʔείʔυதυΫϩʔϯͱͯ͠‫ݕ‬ग़͢Δɽ͜ͷΑ͏ʹɼ‫ݕ‬ग़ͷͨΊͷఆ͔ΒίʔυΫϩʔϯΛ‫ݕ‬ग़͢Δπʔϧͷ։ൃ΍ɼίʔυΫٛ͸໌֬Ͱ͋Δ͕ɼCCFinder ͕‫ݕ‬ग़͢ΔίʔυΫϩʔϯϩʔϯΛղফ͢ΔͨΊͷख๏ͷ‫ߦ͕ڀݚ‬ΘΕ͍ͯΔɽ

͕࣮ࡍʹͲͷΑ͏ͳॲཧΛଟ͘‫ؚ‬ΜͰ͍Δ͔ɼ·ͨͦΕΒͷίʔυΫϩʔϯ͕ͲͷΑ͏ͳཧ༝Ͱ࡞੒͞Ε͍ͯΔͷ͔

1

a)
b)
c)
d)

େࡕେֶ େֶӃ৘ใՊֶ‫ڀݚ‬ՊGraduate School of Information Science and Technology, Osaka University
r-kudou@ist.osaka-u.ac.jp
h-date@ist.osaka-u.ac.jp
ishio@ist.osaka-u.ac.jp
inoue@ist.osaka-u.ac.jp

c 2013 Information Processing Society of Japanʹ͍ͭͯ͸ɼ͸͖ͬΓͱΘ͔͍ͬͯͳ͍ɽίʔυΫϩʔϯ͕࡞ΒΕΔࣄྫͱͯ͠ɼͨͱ͑͹ɼΦϒδΣΫτࢦ޲ϓϩάϥϜͰ͸ɼ։ൃऀ͕΄ͱΜͲಉҰͷॲཧΛෳ਺ͷ৔ॴʹ‫ه‬ड़͠ͳͯ͘͸ͳΒͳ͍৔߹͕͋Δͱ‫ݴ‬ΘΕ͍ͯΔ [2]ɽҰํͰɼ੍‫ߏޚ‬଄͚ͩΛ࠶ར༻ͯ͠ϝιου‫ͼݺ‬ग़͠Λมߋ

1Vol.2013-SE-179 No.15
2013/3/11

৘ใॲཧֶձ‫ڀݚ‬ใࠂ
IPSJ SIG Technical Report͢Δ৔߹΋͋Δ [3]ɽͲͷΑ͏ͳιʔείʔυΛίʔυΫ

2.2 ॏཁͳϝιου‫ͼݺ‬ग़͠ϩʔϯͱͯ͠‫ݕ‬ग़͍ͯ͠Δͷ͔ɼͦͷ಺༰ʹؔ͢Δੑ࣭Λ

Sridhara Β [8] ͸ɼʮϝιουͷ֓ཁΛઆ໌͢Δίϝϯ

஌Δ͜ͱ͸ɼΫϩʔϯͷ෼ੳख๏Λߏங͢Δ্Ͱॏཁͳ՝

τͷ಺༰ͱͯ͠;͞Θ͍͠ʯϓϩάϥϜจΛநग़͠ɼͦΕ୊Ͱ͋ΔɽΛίϝϯτʹม‫͢׵‬Δٕज़ΛఏҊͨ͠ɽϓϩάϥϜจʹ͸ຊ‫Ͱڀݚ‬͸ɼίʔυΫϩʔϯ͕࣋ͭಛ௃Λ໌Β͔ʹ͢ΔͨΊͷୈҰาͱͯ͠ɼϝιουͷ಺෦ʹ‫·ؚ‬ΕΔίʔυΫ༷ʑͳ΋ͷ͕͋Δ͕ɼSridhara Β͸ҎԼͷ 3 ͭͷબ୒‫ج‬४Λ‫͍ͯ͛ڍ‬Δɽϩʔϯʹ͍ͭͯɼͦͷϝιου‫ͼݺ‬ग़͠ʹண໨ͨ͠ௐࠪΛ• ଟ͘ͷϝιουͰ͸ɼԿΒ͔ͷ४උΛߦ͔ͬͯΒ࣮ࡍߦͬͨɽ۩ମతʹ͸ɼίʔυΫϩʔϯதʹग़‫͢ݱ‬ΔʮॏཁͷॲཧΛ࣮ߦ͢ΔͨΊɼϝιουͷ຤ඌʹग़‫͢ݱ‬Δϓͳϝιου‫ͼݺ‬ग़͠ʯͷϝιου໊Λൺֱ͢Δ͜ͱͰɼΫϩάϥϜจ͸ॏཁͰ͋Δɽϩʔϯ͕ϝιουͷ಺෦ͰॏཁͳॲཧΛίϐʔͨ͠΋ͷ• ໭Γ஋͕࢖ΘΕ͍ͯͳ͍͔ɼ໭Γ஋ͷ‫ ͕ܕ‬void Ͱ͋ΔͰ͋Δͷ͔ɼͦΕͱ΋ಉ੍͡‫ߏޚ‬଄Λ͕࣋ͭҟͳΔॲཧΛϝιου‫ͼݺ‬ग़͠จ͸ɼγεςϜʹର͢Δ෭࡞༻Λ࣋࡞੒ͨ͠΋ͷͰ͋Δͷ͔Λௐࠪͨ͠ɽௐࠪͷൣғ͸ɼJavaͭͨΊॏཁͰ͋Δɽ

Ͱ։ൃ͞Εͨ 6 ͭͷΦʔϓϯιʔειϑτ΢ΣΞͷιʔε• ϝιουͱಉ͡ҙຯͷૢ࡞Λ͢ΔϓϩάϥϜจɼͨͱίʔυ͔ΒɼCCFinder ͕‫ݕ‬ग़ͨ͠ίʔυΫϩʔϯͰ͋Δɽ͑͹ compile ͱ͍͏ϝιουதͰ compileRegex ͱ͍ҎԼɼ2 ষͰ͸ຊ‫ڀݚ‬ͷഎ‫͍ͯͭʹܠ‬ղઆ͠ɼ3 ষͰ͸͏Α͏ͳಉҰͷಈࢺΛ࣋ͭϝιου‫ͼݺ‬ग़͠͸ɼ࣮૷ௐࠪํ๏ʹ͍ͭͯड़΂Δɽ4 ষͰ͸ௐࠪͷ݁ՌΛࣔͦ͠Εʹର͢Δߟ࡯Λड़΂Δɽ࠷‫ ʹޙ‬5 ষͰ͸ຊ‫ڀݚ‬ͷ·ͱΊͱࠓ‫ޙ‬ͷ՝୊ʹ͍ͭͯड़΂ΔɽͷৄࡉΛද‫͍ͯ͠ݱ‬ΔͨΊॏཁͰ͋Δɽ

Sridhara Βͷख๏͸ɼ͜ΕΒͷ৚݅Ͱબ͹ΕͨϓϩάϥϜจΛ࣮ߦ͢ΔͨΊʹඞཁͳσʔλΛ४උ͢ΔϓϩάϥϜ
จ΍࣮ߦ੍‫ޚ‬จ΋ಉ࣌ʹநग़͠ɼίϝϯτ΁ͱม‫͢׵‬Δɽ

2. എ‫ܠ‬ϓϩάϥϜจʹ͸Ұൠతͳ୅ೖจ΍࢛ଇԋࢉ΋‫·ؚ‬ΕΔ

2.1 ίʔυΫϩʔϯ͕ɼͦΕΒ͸ίϝϯτʹ൓ө͞ΕΔ͜ͱ͕ͳ͘ɼϝιου։ൃऀ͕‫ه‬ड़͢Διʔείʔυ͕͋Δఔ౓Ҏ্ͷ௕͞Ͱ‫ͼݺ‬ग़͠Λओͳ৘ใ‫͍͍ͯ༻ͯ͠ͱݯ‬Δɽ‫ۮ‬વҰக͢Δ֬཰͸௿͘ [4]ɼଟ͘ͷ৔߹ɼίʔυΫϩʔຊ‫Ͱڀݚ‬͸ɼ͜ͷख๏Ͱநग़͞ΕΔʮϝιουͷ֓ཁΛϯ͸։ൃऀ͕ιʔείʔυΛҙਤతʹෳ੡ͯ͠࠶ར༻͢Δ

આ໌͢Δίϝϯτͷ಺༰ͱͯ͠;͞Θ͍͠ʯϝιου‫ͼݺ‬͜ͱʹΑͬͯੜ͡Δ [3]ɽෳ੡͞Εͨιʔείʔυ͸ͦͷग़͠Λɼʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯͱ‫Ϳݺ‬ɽίʔυΫϩʔ

··࢖͑Δͱ͸‫ݶ‬Βͳ͍ͨΊɼͨͱ͑͹ม਺໊Λෳ੡ઌͷϯ͕ʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯΛଟ͘ίϐʔ͠ɼͦͷ·ιʔείʔυʹ߹ΘͤΔͳͲɼ༷ʑͳฤू͕ߦΘΕΔ [5]ɽ·࠶ར༻͍ͯ͠Δͷ͔Ͳ͏͔Λௐࠪ͢Δ͜ͱͰɼΫϩʔϯ

CCFinder[1] ͸ɼιʔείʔυͷม਺໊΍ϝιου໊ͷม͕ϝιου಺ͷॏཁͳॲཧΛίϐʔͨ͠΋ͷͰ͋Δͷ͔ɼߋͱ͍ͬͨ୯७ͳमਖ਼Λߟྀͨ͠ɼBellon Βͷ෼ྨͰ͍͏λͦΕͱ΋ಉ੍͡‫ߏޚ‬଄Λ͕࣋ͭҟͳΔॲཧΛ࡞੒ͨ͠΋ͷΠϓ 2 ΫϩʔϯΛ‫ݕ‬ग़͢ΔπʔϧͰ͋Δ [6]ɽDECKARD[7]Ͱ͋Δͷ͔Λ໌Β͔ʹ͢Δɽ

ͷΑ͏ͳߏจ໦Λ༻͍Δ‫ݕ‬ग़πʔϧ͸ɼจͷೖΕସ͑ͳͲɼ

ॏཁͳϝιου‫ͼݺ‬ग़͠ͷྫΛਤ 1 ʹࣔ͢ɽ͜ͷਤͷ 4ΑΓଟ͘ͷίʔυमਖ਼͕͋ͬͯ΋ίʔυΫϩʔϯͱͯ͠‫ݕ‬ߦ໨ͷ addElement(input) ͸໭Γ஋͕ར༻͞Ε͍ͯͳ͍ͨ

ग़͢Δ͜ͱ͕Ͱ͖Δ͕ɼຊ‫Ͱڀݚ‬͸࣍ͷ 2 ͭͷཧ༝͔ΒɼΊɼ͜ͷϝιουͰ࣮ߦ͞ΕΔ΂͖ԿΒ͔ͷ෭࡞༻Λ୲ͬ෼ੳର৅Λ CCFinder ͕‫ݕ‬ग़͢ΔίʔυΫϩʔϯͱͨ͠ɽ

͍ͯΔʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯͱͳΔɽ·ͨɼίʔυ

• CCFinder ͸τʔΫϯͷྻΛൺֱ͢ΔͨΊɼ͋Δίʔ

ͷ 6 ߦ໨ͷ append(result) ͸ returnPressed ϝιουͷ຤υยͷͲͷτʔΫϯ͕ɼଞͷίʔυยͷͲͷτʔΫϯඌʹ͋ͨΔͨΊɼ͜ͷϝιου͕࠷ऴతʹ࣮ߦ͠ͳ͚ΕʹରԠ͚ͮΒΕ͔ͨΛ஌Δ͜ͱ͕Ͱ͖Δɽ͢ͳΘͪɼ͹ͳΒͳ͍ॲཧΛද‫͢ݱ‬Δʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯͱ։ൃऀ͕ιʔείʔυΛίϐʔͨ͠‫ʹޙ‬มߋͨ͠ͱࢥ

ͳΔɽͦͯ͠ɼͦͷϝιου‫ͼݺ‬ग़͠ͷҾ਺ʹ࢖ΘΕ͍ͯΘΕΔൣғΛίʔυΫϩʔϯͷ಺༰͔Β൑அ͢Δ͜ͱ

Δม਺ result ʹؔ͢Δσʔλґଘؔ܎Λ୧Δͱɼ5 ߦ໨ͷ͕Ͱ͖Δɽ

evaluate(input) ‫ͼݺ‬ग़͠ͷ໭Γ஋͕ result ʹ୅ೖ͞Ε͍ͯ• τʔΫϯྻͷൺֱΛ༻͍ͨίʔυΫϩʔϯ‫ݕ‬ग़ͷ࣮૷
*1

ͱͯ͠ CCFinderX ͕ެ։͞Ε͓ͯΓɼ‫ݕ‬ग़͞ΕΔ
ίʔυΫϩʔϯʹؔ͢Δ஌͕ࣝɼ‫ߦͰͲͳۀا‬ΘΕ͍ͯΔ༷ʑͳ෼ੳ‫׆‬ಈʹ໾ཱͭՄೳੑ͕͋Δɽ

Δ͜ͱ͔Βɼ͜Ε΋ʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯͱͳΔɽ

3. ௐࠪํ๏
ຊ‫Ͱڀݚ‬͸ɼCCFinder ͕‫ݕ‬ग़ͨ͠ίʔυΫϩʔϯʹ͍ͭͯɼҎԼͷ 2 ͭͷௐ࣭ࠪ໰ʹؔ͢Δ෼ੳΛߦͬͨɽ

RQ1 ίʔυΫϩʔϯ͸ɼͦͷग़‫ݱ‬৔ॴʹΑͬͯॲཧͷ಺*1

AIST
CCFinderX,ccfinderx-j.html

http://www.ccfinder.net/

c 2013 Information Processing Society of Japan༰͕ҟͳΔ͜ͱ͸͋Δͷ͔ɽ

RQ2 ίʔυΫϩʔϯ͸ɼϝιουͷओཁͳॲཧΛߦͳͬ

2

Vol.2013-SE-179 No.15
2013/3/11

৘ใॲཧֶձ‫ڀݚ‬ใࠂ
IPSJ SIG Technical Reportx = getX();y = getY();z = 3;

z = 3;

n = getN(x, z);n = getN(y, z);return n;

return n;


ਤ 1





ίʔυ 1
ਤ 2

endingɼvoid-returnɼdata-facilitating ͷίʔυྫ [8]Fig. 1 An example of ending, void-return and data-facilitating



ίʔυ 2
ίʔυΫϩʔϯͷྫ

Fig. 2 An example of code clone

method calls [8]3.3 ॏཁͳϝιου‫ͼݺ‬ग़͠ͷೝࣝʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯ͸ɼղੳର৅ͷιϑτ΢Σ
͍ͯΔ෦෼Λίϐʔͨ͠΋ͷͰ͋Δͷ͔ɽΞͷ֤ϝιουఆٛΛղੳ͢Δ͜ͱͰಘΒΕΔɽSridharaΒ [8] ͷఆٛͨ͠ॏཁͳϓϩάϥϜจͷ൑ఆʹ͸ɼJava ιʔ

3.1 ௐࠪର৅

είʔυͷߏจ͚ͩͰͳ੍͘‫ޚ‬ϑϩʔɼσʔλϑϩʔͷղௐࠪର৅ͱͯ͠ϓϩάϥϛϯά‫ ޠݴ‬Java Ͱ‫ه‬ड़͞Εͨੳ͕ඞཁͰ͋Δ͜ͱ͔Βɼຊ‫Ͱڀݚ‬͸ Java όΠτίʔυ

6 ͭͷΦʔϓϯιʔειϑτ΢ΣΞΛબ୒ͨ͠ɽίʔυΫղੳΛ༻͍ͯɼSridhara Βͷఆٛʹैͬͨநग़ͷखॱΛҎϩʔϯͷ‫ݕ‬ग़ʹ࢖༻ͨ͠ CCFinder ͷόʔδϣϯ͸ 7.2.4.0ԼͷΑ͏ʹ࣮૷ͨ͠ɽ

Ͱ͋Δɽ‫ݕ‬ग़ͷύϥϝʔλ͸͢΂ͯ CCFinder ͷσϑΥϧ

·ͣɼղੳର৅ͷϝιουʹରͯ͠ɼ੍‫ޚ‬ϑϩʔάϥϑτ஋Ͱ͋Γɼ30 τʔΫϯҎ্ͷ௕͞ͷίʔυΫϩʔϯΛͱϓϩάϥϜґଘάϥϑʢPDGʣ[10] Λߏங͢Δɽͨͩ͠ɼ

ௐࠪର৅ͱͨ͠ɽͨͩ͠ɼCCFinder ͕‫ݕ‬ग़ͨ͠ίʔυΫ

Java ͷόΠτίʔυ͸ԋࢉʹΦϖϥϯυελοΫͱϩʔΧϩʔϯͷ͏ͪɼίʔυΫϩʔϯϝτϦΫε RNR[9] ͷ஋͕ϧม਺ͷ 2 छྨΛ༻͍ΔͨΊɼσʔλґଘؔ܎͸ɼΦϖϥ

0.5 ҎԼͱͳΔΫϩʔϯηοτΛௐࠪର৅͔Βআ֎͍ͯ͠

ϯυελοΫΛ‫ܦ‬༝ͨ͠΋ͷͱɼϩʔΧϧม਺Λ‫ܦ‬༝ͨ͠ΔɽRNR ͱ͸ίʔυͷඇ‫܁‬Γฦ͠཰ͷ͜ͱͰ͋Γɼίʔυ΋ͷΛ۠ผͯ͠நग़͓ͯ͘͠ɽಘΒΕͨάϥϑΛ༻͍ͯɼʹಉ͡ฒͼͷ‫܁‬Γฦ͕͠ଟ͍ͱɼ͜ͷ஋͕௿͘ͳΔɽRNR

endingɼvoid-returnɼsame-action ͱ͍͏ 3 ͭͷϝιου

ͷ஋͕௿͍ίʔυ͸ม਺ͷฒͼ΍ if จͳͲͷ੍‫ޚ‬จͷ‫܁‬Γ‫ͼݺ‬ग़໋͠ྩͷू߹ΛҎԼͷΑ͏ʹநग़͢Δɽฦ͠ʹͳ͍ͬͯΔ͜ͱ͕ଟ͘ɼ։ൃऀʹͱͬͯ͸‫ڵ‬ຯ͕ͳ

ending ιʔείʔυʹ͓͍ͯϝιου຤ඌͷจ͔ɼre-͍΋ͷ͕ଟ͍͜ͱ͕‫ݧܦ‬తʹΘ͔͍ͬͯΔͨΊɼ෼ੳର৅

turn ໋ྩͷ໭Γ஋ͷࣜʹొ৔͢Δϝιου‫ͼݺ‬ग़͔͠Βআ֎ͨ͠ɽௐࠪର৅ͷ 6 ͭͷιϑτ΢ΣΞͷҰཡͱι໋ྩͷू߹ɽόΠτίʔυͰ͸ɼ໭Γ஋Λฦ͞ͳ͍ϑτ΢ΣΞͷ‫ن‬໛ɼ‫ݕ‬ग़͞ΕͨΫϩʔϯηοτͷ਺ɼRNR

RETURN ໋ྩͷ௚લʹ͋Δ໋ྩɼ͋Δ͍͸஋Λฦ͢ͷ஋ʹΑΔϑΟϧλϦϯάΛߦ͍࠷ऴతʹ෼ੳΛߦͬͨΫ

RETURN ໋ྩࣗମΛ‫ͯ͠ͱ఺ج‬ɼJava Ծ૝Ϛγϯͷϩʔϯηοτͷ਺Λද 1 ʹࣔ͢ɽελοΫΛ‫ܦ‬༝ͨ͠σʔλґଘؔ܎Λ‫ޙ‬Ζ޲͖ʹ୧ͬͯ౸ୡՄೳͳൣғʹ͋Δϝιου‫ͼݺ‬ग़໋͠ྩͷू߹

3.2 ࣝผࢠͷมߋ

ͱͳΔɽ

CCFinder ʹΑͬͯ‫ݕ‬ग़͞ΕΔίʔυΫϩʔϯ͸ίʔυ

void-return ໭Γ஋͕࢖ΘΕ͍ͯͳ͍͔ɼ໭Γ஋ͷ‫͕ܕ‬͝ͱͷτʔΫϯ਺͕౳͘͠ɼ·ͨτʔΫϯͷछྨͷฒͼ΋void Ͱ͋Δϝιου‫ͼݺ‬ग़໋͠ྩͷू߹ɽόΠτίʔҰக͢Δ͜ͱ͕อূ͞Ε͍ͯΔͨΊɼ‫ʹ͍ޓ‬ΫϩʔϯͱυͰ͸ɼ໭Γ஋͕࢖༻͞Εͳ͍৔߹ɼϝιου‫ͼݺ‬ग़ͳ͍ͬͯΔίʔυؒͰʮಉ͡Ґஔʹଘࡏ͢ΔࣝผࢠʯΛ໋ܾ͠ྩͷ௚‫ʹޙ‬໭Γ஋Λഁ‫͢غ‬Δ໋ྩ͕ૠೖ͞ΕΔ͜

ఆͰ͖Δɽ͜ͷʮಉ͡Ґஔʹଘࡏ͢Δࣝผࢠʯͷ໊લΛൺද 2΂ͨͱ͖ʹɼΫϩʔϯηοτ಺ͷ͢΂ͯͷίʔυͰ໊લ͕Ұக͢Δ৔߹ɼ͜ͷࣝผࢠ͸ʮ໊લ͕มߋ͞Ε͍ͯͳ͍ʯ
ɼ

ਤ 2 ͷίʔυΫϩʔϯʹ‫·ؚ‬ΕΔࣝผࢠ

Table 2 Identiﬁers involved in the code clones of Fig.2

ͦΕҎ֎ͷ৔߹͸ʮ໊લ͕มߋ͞Ε͍ͯΔʯͱఆٛ͢Δɽ

ίʔυ 1

ίʔυ 2

छྨ

มߋͷ༗ແ

֤ࣝผࢠ͕ϝιου‫ͼݺ‬ग़͠Ͱ͋Δ͔Ͳ͏͔͸֤ιʔε

x

y

ม਺

͋Γ

ϑΝΠϧͷߏจ໦ʹΑͬͯ൑அ͢Δ͜ͱ͕Ͱ͖ΔͷͰɼ
ʮಉ

getX

getY

ϝιου‫ͼݺ‬ग़͠

͋Γ

z

z

ม਺

ͳ͠

͡Ґஔʹଘࡏ͢Δϝιου‫ͼݺ‬ग़͠ʯͷ໊લΛൺ΂Δ͜ͱ

3

3

Ϧςϥϧ

ͳ͠

n

n

ม਺

ͳ͠

มߋ͞Ε͍ͯΔϝιου‫ͼݺ‬ग़͠ʯΛ۠ผ͢Δɽྫͱͯ͠ɼ

getN

getN

ϝιου‫ͼݺ‬ग़͠ͳ͠

ਤ 2 தͷίʔυ 1 ͱίʔυ 2 ͕Ϋϩʔϯͱͯ͠‫ݕ‬ग़͞Ε

x

y

ม਺

͋Γ

ͨ৔߹ʹɼ͜ΕΒ 2 ͭͷίʔυʹ‫·ؚ‬ΕΔࣝผࢠΛॱ൪ʹ

z

z

ม਺

ͳ͠

நग़ͯ͠ൺֱͨ݁͠ՌΛද 2 ʹࣔ͢ɽ

n

n

ม਺

ͳ͠

Ͱʮ໊લ͕มߋ͞Ε͍ͯͳ͍ϝιου‫ͼݺ‬ग़͠ʯɼʮ໊લ͕c 2013 Information Processing Society of Japan

3

Vol.2013-SE-179 No.15
2013/3/11

৘ใॲཧֶձ‫ڀݚ‬ใࠂ
IPSJ SIG Technical Reportද 1ௐࠪର৅ͷιϑτ΢ΣΞͱ‫ݕ‬ग़͞ΕͨΫϩʔϯηοτ਺

Table 1 Analyzed software and their code clones
SoftwareVersion

#File

LOC

#Method#Clone Set#Analyzed Clone Set

Derby*1

10.9.1.0

1,445

549,91121,653

2,302

1,384

h2*2

1.3.168500

135,114

7,184

1,315

569

jTunes*3(2009.12.12)

519

134,243

7,296

1,324

675

Tomcat*4

7.0.27

1,242

348,856

16,916

3,518

1,962

XXL*5

1.0

633

178,230

7,914

832

509

zk*6

6.5.0

406

77,772

4,851

338

229

ͱΛར༻ͯ͠ɼ֘౰͢Δϝιου‫ͼݺ‬ग़໋͠ྩͷू߹

facilitating ͷ໋֤ྩ੍͕‫ޚ‬ґଘ͢Δ৚݅෼‫͍ͭʹذ‬Λநग़͢Δ͜ͱ͕Ͱ͖Δɽͯɼͦͷ৚݅ࣜʹ࢖ΘΕ͍ͯΔʢ৚݅෼‫͔ྩ໋ذ‬ΒΦ

same-action ‫ͼݺ‬ग़͍ͯ͠Δϝιου໊Λ CamelCaseϖϥϯυελοΫʹؔ͢Δσʔλґଘؔ܎Ͱ౸ୡՄೳ

ͷϧʔϧʹैͬͯ୯‫ޠ‬୯Ґʹ෼ׂͨ͠৔߹ʹɼͦͷઌͳൣғʹ͋Δʣϝιου‫ͼݺ‬ग़͠ͷू߹ΛऔΓग़͢ɽ಄୯‫͕ޠ‬ղੳର৅ͷϝιουͱҰக͢Δϝιου‫ͼݺ‬۩ମతʹ͸ɼ੍‫ޚ‬ґଘؔ܎ղੳΛ༻͍ͯɼ֤ϝιουग़໋͠ྩͷू߹ɽ

ͷ࣮ߦ৚݅ͱͳΔ͢΂ͯͷʢਪҠతͳ੍‫ޚ‬ґଘؔ܎Λͨͩ͠ɼҎԼͷ৚݅ͷ͍ͣΕ͔ʹ౰ͯ͸·Δϝιου‫ݺ‬࣋ͭʣ৚݅෼‫ྩ໋ذ‬Λऔಘ͠ɼͦΕΒͷ৚݅෼‫ذ‬ͷ஋ͼग़໋͠ྩ͸ॏཁͰͳ͍ͱ൑அ͠আ֎͢Δɽʹ࢖ΘΕͨϝιου‫ͼݺ‬ग़໋͠ྩΛऔΓग़͢ɽ͜͜

• void-return ͱ same-action ϝιου‫ͼݺ‬ग़໋͠ྩͷ͏Ͱ΋ɼget/set ౳ͷϝιου‫ͼݺ‬ग़͠͸ީิ͔Βআ֎ͪɼίϯετϥΫλɼ໊લ͕ get ͋Δ͍͸ set ͔Β࢝·͢ΔɽΔϝιουɼจࣈྻͷՃࢉʹ࢖༻͞ΕΔ StringBuilder͜ͷҰ࿈ͷॲཧΛ‫ٻͯܦ‬Ίͨɼendingɼvoid-returnɼsame-Ϋϥε͓Αͼ StringBuﬀer Ϋϥεͷ append ϝιουactionɼdata-facilitatingɼcontrolling ͷ 5 ͭͷϝιου‫ݺ‬ʹର͢Δ‫ͼݺ‬ग़໋͠ྩɽ

ͼग़͠ू߹ͷ࿨ू߹͕ɼ࠷ऴతʹ‫ٻ‬ΊΔʮॏཁͳϝιου• ྫ֎ϋϯυϥͷதʹ‫ه‬ड़͞Ε͍ͯΔ‫ͼݺ‬ग़໋͠ྩɽ

‫ͼݺ‬ग़͠ʯͱͳΔɽίʔυΫϩʔϯ͸ιʔείʔυʹର͠• ͋Δม਺͕ null Ͱ͋Δ͜ͱɼ·ͨ͸ null Ͱͳ͍͜ͱ͕

ͯ‫͞ࢉܭ‬ΕΔͷͰɼίʔυΫϩʔϯʹ‫·ؚ‬ΕΔϝιου‫ݺ‬࣮ߦ৚݅ͱͳΔΑ͏ͳϝιου‫ͼݺ‬ग़໋͠ྩɽ

• ϩΪϯά΍ྫ֎ॲཧʹؔ࿈͢ΔͱࢥΘΕΔϝιου

ͼग़͠ͱόΠτίʔυʹग़‫͢ݱ‬Δ‫ͼݺ‬ग़͠ͱ͸ɼߦ൪߸ͱ
໊લʹΑͬͯରԠ෇͚Δɽ‫ͼݺ‬ग़͠ɽ͢ͳΘͪɼϝιου໊ʹ log, trace, error,

debug, exception, close ͕‫·ؚ‬ΕΔϝιου‫ͼݺ‬ग़͠

3.4 ௐࠪ͢ΔϝτϦΫε

໋ྩɽ֤Ϋϩʔϯηοτʹରͯ͠ɼҎԼͷ৘ใΛऩूͨ͠ɽ

Ҏ্ͷखॱͰ‫ٻ‬Ίͨ endingɼvoid-returnɼsame-action• Ϋϩʔϯηοτ಺ͷίʔυʹ‫·ؚ‬ΕΔ͢΂ͯͷϝιοͷϝιου‫ͼݺ‬ग़͠ʹରͯ͠σʔλΛఏ‫͢ڙ‬Δॲཧɼ࣮ߦ

υ‫ͼݺ‬ग़͠Λɼʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯͱʮॏཁͰ

Λ੍‫͢ޚ‬ΔॲཧΛ data-facilitating ͱ controlling ͱͯ͠Ҏͳ͍ϝιου‫ͼݺ‬ग़͠ʯʹ෼͚ΔɽʮॏཁͳϝιουԼͷΑ͏ʹఆٛ͢Δɽ‫ͼݺ‬ग़͠ʯͷ͏ͪɼ໊લ͕มߋ͞Ε͍ͯΔϝιου‫ݺ‬data-facilitating ֤ϝιου‫ͼݺ‬ग़͠ʹରͯ͠σʔλΛͼग़͠ͷׂ߹Λʮॏཁͳϝιου‫ͼݺ‬ग़͠ͷมߋ౓߹‫͢څڙ‬Δϝιου‫ͼݺ‬ग़໋͠ྩͷू߹ɽendingɼvoid-(A)ʯͱ͢Δɽ·ͨɼʮॏཁͰͳ͍ϝιου‫ͼݺ‬ग़͠ʯ

returnɼsame-action ʹ‫·ؚ‬ΕΔϝιου‫ͼݺ‬ग़໋͠ͷ͏ͪɼಉ༷ʹ໊લ͕มߋ͞Ε͍ͯΔϝιου‫ͼݺ‬ग़ྩͷҾ਺ͦΕͧΕΛ‫ͯ͠ͱ఺ج‬ɼΦϖϥϯυελοΫ

͠ͷׂ߹ΛʮॏཁͰͳ͍ϝιου‫ͼݺ‬ग़͠ͷมߋ౓߹ʹΑΔσʔλґଘؔ܎Λ୧ΓɼϩʔΧϧม਺ʹؔ͢Δ(B)ʯͱ͢Δɽσʔλґଘؔ܎Λͨͩ̍౓͚ͩ୧ΓʢϓϩάϥϜจؒ• Ϋϩʔϯηοτ಺ͷ͢΂ͯͷϝιου‫ͼݺ‬ग़͠ͷ͏ͷσʔλґଘؔ܎ʹ૬౰͢Δʣɼ͞ΒʹΦϖϥϯυε

ͪɼʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯͷׂ߹ΛɼʮΫϩʔϯλοΫʹΑΔσʔλґଘؔ܎Λ୧ͬͯ౸ୡͰ͖Δൣ

ͱͳ͍ͬͯΔίʔυͷॏཁͳϝιου‫ͼݺ‬ग़͠ͷׂ߹ғʹ͋Δϝιου‫ͼݺ‬ग़໋͠ྩΛநग़͢Δɽͨͩ͠ɼ

void-return ͓Αͼ same-action ʹରͯ͠ߦͬͨͷͱಉ༷ʹɼίϯετϥΫλɼ໊લ͕ get ͋Δ͍͸ set ͔Β

*1
*2
*3

࢝·Δϝιουɼจࣈྻͷ݁߹ʹؔ͢Δϝιου‫ͼݺ‬ग़໋͠ྩ͸ɼ͜ͷީิ͔Βআ֎͢Δɽ*4*5

controlling endingɼvoid-returnɼsame-actionɼdata*6

c 2013 Information Processing Society of Japan

Apache Derby, http://db.apache.org/derby/
h2, http://www.h2database.com/html/main.html
jTunes,http://sourceforge.jp/projects/sfnet_
jtunes-online/
Apache Tomcat, http://tomcat.apache.org/
XXL,
http://dbs.mathematik.uni-marburg.de/home/research/projects/xxl/
zk, http://www.zkoss.org/

4Vol.2013-SE-179 No.15
2013/3/11

৘ใॲཧֶձ‫ڀݚ‬ใࠂ
IPSJ SIG Technical Report(C)ʯͱ͢Δɽ

ͷ໊લ͕มߋ͞ΕΔ͜ͱ͕ॏཁͰͳ͍ϝιου‫ͼݺ‬ग़͠ʹ• Ϋϩʔϯηοτͷ֤ίʔυย͕ଘࡏ͍ͯ͠Δϝιου

ൺ΂ͯগͳ͍͜ͱΛ֬ೝ͢ΔͨΊɼ֤Ϋϩʔϯηοτͷʮॏͷू߹ΛऔΓग़͠ɼͦΕΒʹ‫·ؚ‬ΕΔϝιου‫ͼݺ‬ग़ཁͳϝιου‫ͼݺ‬ग़͠ͷมߋ౓߹ (A)ʯͱʮॏཁͰͳ͍ϝ͠Λྻ‫͢ڍ‬ΔʢίʔυΫϩʔϯΛ 1 ߦͰ΋‫ؚ‬ΜͰ͍Ειου‫ͼݺ‬ग़͠ͷมߋ౓߹ (B)ʯͷ෼෍ʹ͍ͭͯɼWilcoxon͹ɼͦͷϝιου͸Ϋϩʔϯ͕ଘࡏ͍ͯ͠Δϝιου

ͷॱҐ࿨‫ݕ‬ఆΛద༻ͨ͠ɽ֤ιϑτ΢ΣΞͷ (A)ɼ(B) ͷͱ͢ΔʣɽͦͷதͰɼ
ʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯͷׂ஋ͷ౓਺෼෍දΛද 4 ʹࣔ͢ɽ‫ݕ‬ఆ݁ՌΛද 5 ʹ͕ࣔ͢ɼ߹ΛɼʮΫϩʔϯ͕ଘࡏ͍ͯ͠ΔϝιουશମͰͷॏ͢΂ͯͷιϑτ΢ΣΞʹ͓͍ͯ༗ҙਫ४ 1%Ͱ‫ؼ‬ແԾઆΛཁͳϝιου‫ͼݺ‬ग़͠ͷׂ߹ (D)ʯͱ͢Δɽ‫غ‬٫͠ɼ2 ‫͕͋ࠩʹ܈‬Δ͜ͱΛ֬ೝͨ͠ɽ͜ͷ͜ͱ͔Βɼͳ͓ɼʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯ͸ɼΫϩʔϯηοτ಺

RQ1 ʹର͢Δ౴͑͸ɼʮॏཁͳϝιου‫ͼݺ‬ग़͠ͷ໊લ͸ͷ͋ΔίʔυยͰ͸ॏཁͰ͋ͬͯ΋ɼผͷίʔυยͷରԠมߋ͞ΕΔ͜ͱ͸গͳ͘ɼίʔυ͕ίϐʔ͞Εͯ΋ͦͷओ͢ΔҐஔʹ͋Δϝιου‫ͼݺ‬ग़͠Ͱ͸ॏཁͰͳ͍ͱ͍͏͜

ཁͳॲཧ͕มΘΔ͜ͱ͸গͳ͍ʯͱ͍͏΋ͷʹͳΔɽ

ͱ͕͋Γ͏Δɽͨͱ͑͹ɼ։ൃऀ͕ϝιουશମΛίϐʔίʔυΫϩʔϯͷಛ௃Λ͞Βʹৄ͘͠ௐ΂ΔͨΊɼʮॏͯ͠ɼ຤ඌʹ 1 ͭϝιου‫ͼݺ‬ग़͠Λॻ͖Ճ͑Δͱɼ‫ݩ‬ʑཁͳϝιου‫ͼݺ‬ग़͠ʯ͕มߋ͞Ε͍ͯͳ͍Ϋϩʔϯηο຤ඌʹ͋ͬͨϝιου‫ͼݺ‬ग़͠͸ɼending ͷ৚͔݅Β֎τͱʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯ͕ଟ͘มߋ͞Ε͍ͯΔΫΕͯ͠·͏ɽ͜ͷΑ͏ͳ৔߹Ͱ͋ͬͯ΋ɼ(A)ɼ(B)ɼ(C)ɼ

ϩʔϯηοτΛͦΕͧΕ֤ιϑτ΢ΣΞ͔Β 5 ྫͣͭ‫ ܭ‬30(D) ͷ 4 ͭͷ஋͸‫ࢉܭ‬ՄೳͰ͋ΔɽྫΛແ࡞ҝʹऔΓग़͠ɼ࣮ࡍʹίʔυΛӾཡͯ͠ௐࠪͨ͠ɽ
ʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯ͕มߋ͞Ε͍ͯͳ͍Ϋϩʔ

4. ௐࠪ݁Ռ

ϯηοτʹ‫·ؚ‬ΕΔίʔυΛௐ΂ͨ݁Ռɼ30 ྫͷ͏ͪ 22

4.1 ॏཁͳϝιου‫ͼݺ‬ग़͠ͱॏཁͰͳ͍ϝιου‫ͼݺ‬ग़͠ͷൺֱྫͰɼʮผύοέʔδͷಉ໊Ϋϥεʯ΍ʮผΫϥεͷಉ໊ϝιουʯͳͲɼ‫׬‬શʹಉҰͰ͸ͳ͍͕ɼଘࡏ͢Δύο

RQ1 ʹؔͯ͠ɼ·ͣɼ֤ιϑτ΢ΣΞͷʮॏཁͳϝιοέʔδ໊ɼΫϥε໊ɼϝιου໊ͷ͍ͣΕ͔͕ಉ͡Ͱ͋Δυ‫ͼݺ‬ग़͠ʯ͕มߋ͞Ε͍ͯͳ͍Ϋϩʔϯηοτͷ਺ͱͦίʔυ͕Ϋϩʔϯηοτͱͳ͍ͬͯͨɽͨͱ͑͹ɼTomcatʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯ͕มߋ͞
ͷׂ߹Λද 3 ʹࣔ͢ɽ

ͷɼAjpNioProcessor Ϋϥεͷ process ϝιουͱɼAjpA-Ε͍ͯͳ͍ίʔυΫϩʔϯ͸ 87.0%ͱͳ͓ͬͯΓɼ͢΂ͯ

prProcessor Ϋϥεͷ process ϝιου͔Βʮॏཁͳϝιοͷ‫ͼݺ‬ग़͕͠มߋ͞Ε͍ͯͳ͍ίʔυΫϩʔϯͷ 60.9%ʹ

υ‫ͼݺ‬ग़͠ʯ͕มߋ͞Ε͍ͯͳ͍Ϋϩʔϯηοτ͕‫ݕ‬ग़͞ൺ΂ͯ΋ߴ͍஋ͱͳ͍ͬͯΔɽ
ʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯΕ͍ͯΔɽҰํɼʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯͷมߋ౓߹͕ߴ͍Ϋද 3ϝιου‫ͼݺ‬ग़͕͠มߋ͞Ε͍ͯͳ͍Ϋϩʔϯηοτͷ਺

Table 3 Clone sets whose “important method calls” are not
modiﬁedϩʔϯηοτΛௐ΂ͨͱ͜Ζɼ੍‫ߏޚ‬จΛ‫܁‬Γฦ͠‫ه‬ड़͍ͯ͠Δίʔυ͕ଟ֬͘ೝ͞Εͨɽ͜Ε͸ɼ։ൃऀʹͱͬͯ‫ڵ‬ຯ͕ͳ͍ͱࢥΘΕΔछྨͷΫϩʔϯηοτͰ͋Δ͕ɼ‫܁‬ॏཁͳ‫ͼݺ‬ग़͠ͷΈมߋͳ͠શ‫ͼݺ‬ग़͕͠มߋͳ͠

Software

‫਺ݸ‬

ׂ߹

‫਺ݸ‬

ׂ߹

Derby

1,308

94.5%

833

60.2%

570

79.3%

292

51.2%

ʹ zk ͷ ConﬁgParser Ϋϥε͔Β‫ݕ‬ग़͞ΕͨίʔυͰ͋Γɼh2Γฦ͠ճ਺͕গͳ͍ͨΊ RNR ʹΑͬͯϑΟϧλϦϯά͞Εͳ͔ͬͨͱߟ͑ΒΕΔɽਤ 3 ͸ίʔυ 1ɼίʔυ 2 ͱ΋

jTunes

599

88.7%

501

74.2%

͜ͷ 2 ͭͷίʔυ͕Ϋϩʔϯηοτͱͳ͍ͬͯΔɽ͜ͷྫ

Tomcat

1,661

84.7%

1,183

60.3%

Ͱ͸ɼ੍‫ߏޚ‬จ͕‫܁‬Γฦ͠‫ݱ‬ΕͯɼͦΕͧΕͷ੍‫ߏޚ‬จͷ

XXL

423

82.9%

324

63.5%

தͰ໭Γ஋ͷͳ͍ϝιουΛ‫ͼݺ‬ग़͍ͯ͠Δɽ͜ͷϝιο

zk

196

85.6%

114

49.8%

߹‫ܭ‬

4,639

87.0%

3,247

60.9%

υ‫ͼݺ‬ग़͠͸ void-return ͷʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯͰද 5(A) ͱ (B)ɼ(C) ͱ (D) ʹର͢Δ Wilcoxon ͷॱҐ࿨‫ݕ‬ఆTable 5 Wilcoxon’s rank sum test for (A) and (B), (C) and͋Δɽ͜ͷϝιου‫ͼݺ‬ग़͠Ͱ‫ͼݺ‬ग़͍ͯ͠Δϝιου͕ΫϩʔϯؒͰҟͳΔͨΊɼʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯͷมߋ౓߹͕ߴ͘ͳ͍ͬͯΔɽ͜ͷΑ͏ͳɼ੍‫ߏޚ‬จͷ‫܁‬Γฦ͠Ͱ‫ه‬ड़͞ΕͨΫϩʔϯηοτ͕ଟ਺֬ೝ͞Εɼௐࠪͨ͠(D)(A) ͱ (B)(C) ͱ (D)30 ྫத 18 ྫ͕͜Εʹ֘౰ͨ͠ɽ·ͨɼ࢒ͬͨ 12 ྫத 7 ྫ‫ؼ‬ແԾઆ

p஋‫ؼ‬ແԾઆ

͸ɼ໭Γ஋ͷͳ͍ϝιουΛ‫܁‬Γฦ͠‫ͼݺ‬ग़͍ͯ͠Δίʔ

Derby< 0.0001‫غ‬٫

0.0013‫غ‬٫υͰ͋ͬͨɽ͜ΕΒͷίʔυΫϩʔϯ͸։ൃऀ͕‫ݕ‬ग़ͨ͠h2< 0.0001‫غ‬٫

0.0538‫غ‬٫͞Εͳ͍

0.0057‫غ‬٫

0.0730‫غ‬٫͞Εͳ͍͍ίʔυΫϩʔϯͰ͋ΔՄೳੑ͸௿͍ɽ͜ͷ͜ͱ͔Βɼʮॏ

jTunesTomcat< 0.0001‫غ‬٫< 0.0001‫غ‬٫ཁͳϝιου‫ͼݺ‬ग़͠ʯͷมߋ౓߹͕ߴ͍ΫϩʔϯηοτXXL

0.0032‫غ‬٫

0.4451‫غ‬٫͞Εͳ͍ΛϑΟϧλϦϯά͢Δ͜ͱͰɼ։ൃऀͷ‫ڵ‬ຯͷͳ͍ίʔυ

zk< 0.0001‫غ‬٫

0.4197‫غ‬٫͞Εͳ͍ΫϩʔϯΛআ‫͠ڈ‬ɼ໨తͷίʔυΫϩʔϯΛ‫ݕ‬ग़͢Δखॿ

Softwarep஋

c 2013 Information Processing Society of Japan

5

Vol.2013-SE-179 No.15
2013/3/11

৘ใॲཧֶձ‫ڀݚ‬ใࠂ
IPSJ SIG Technical Reportද 4(A) ͓Αͼ (B) ͷ౓਺෼෍ද

Table 4 Frequency distribution table of (A) and (B)
Derby

h2

jTunesTomcat

XXL

zk

(A)

(B)

(A)

(B)

(A)

(B)

(A)

(B)

(A)

(B)

(A)

(B)

[0.0 − 0.1]

1,308

886

454

368

601

567

1,662

1,430

423

390

196

136

(0.1 − 0.2]

6

40

11

71

11

21

24

90

12

16

1

14

(0.2 − 0.3]

4

23

4

24

20

16

19

76

15

13

2

4

(0.3 − 0.4]

10

59

22

42

6

28

49

99

19

19

6

18

(0.4 − 0.5]

23

47

27

19

7

9

70

85

18

24

10

9

(0.5 − 0.6]

0

6

3

3

0

0

9

22

2

1

3

1

(0.6 − 0.7]

4

13

13

10

3

2

20

15

5

5

2

2

(0.7 − 0.8]

2

3

3

1

1

2

7

12

0

2

0

2

(0.8 − 0.9]

0

0

0

1

0

0

0

8

0

0

0

0

(0.9 − 1.0]

27

307

32

30

26

30

102

125

15

39

9

43



 ͯίϐʔ͞Ε͍ͯΔͱ͸‫ݶ‬Βͳ͍ͱߟ͑ΒΕΔɽ

if (v != null)
config.setSessionMaxRequests(v.intValue());

4.3 ʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯͷಛ௃v = parseInteger(el, "max-pushes-per-session", ANY_VALUE);ຊ‫ڀݚ‬ͷௐࠪ͸ɼSridhara Β͕ఆٛͨ͠ʮϝιουͷ֓ཁif (v != null)Λઆ໌͢Δʯϝιου‫ͼݺ‬ग़͠ʹґଘ͍ͯ͠ΔɽSridhara

config.setSessionMaxPushes(v.intValue());
String s=el.getElementValue("timer-keep-alive", true);Βͷௐࠪ [8] Ͱ͸நग़݁Ռʹର͢Δ༗༻ੑʹ͍ͭͯͷධՁ

if (s != null)͸ߦΘΕ͍ͯΔ͕ɼͲͷΑ͏ͳϝιου‫ͼݺ‬ग़͕͠۩ମ

config.setTimerKeepAlive("true".equals(s));

 తʹʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯͱ൑ఆ͞ΕΔ͔͸ৄ͘͠
ίʔυ 1



 ‫ه‬ड़͞Ε͍ͯͳ͍ɽͦ͜ͰɼͲͷΑ͏ͳϝιου͕ʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯʹΑͬͯ‫ͼݺ‬ग़͞ΕɼͲͷΑ͏ͳϝif (v != null)ιου͕ʮॏཁͰͳ͍ϝιου‫ͼݺ‬ग़͠ʯʹΑͬͯ‫ͼݺ‬ग़

config.setProcessingPromptDelay(v.intValue());
v = parseInteger(conf, "tooltip-delay", POSITIVE_ONLY);͞ΕΔͷ͔ௐࠪΛߦͬͨɽif (v != null)

4.3.1 ϝιουͷ෼ྨ

config.setTooltipDelay(v.intValue());·ͣɼ֤ιϑτ΢ΣΞͷιʔείʔυதͰએ‫͞ݴ‬Ε͍ͯString s=conf.getElementValue("keep-across-visits", true);if (s != null)ΔϝιουΛɼৗʹॏཁͳϝιου‫ͼݺ‬ग़͠ʹΑͬͯ‫ͼݺ‬

config.setKeepDesktopAcrossVisits(!"false".equals(s));




ίʔυ 2

ग़͞ΕΔ΋ͷʢ͢΂ͯͷ‫ͼݺ‬ग़͠‫͕ݩ‬ʮॏཁͳϝιου‫ݺ‬ͼग़͠ʯͰ͋Δ΋ͷʣɼৗʹॏཁͰͳ͍ϝιου‫ͼݺ‬ग़͠ʹΑͬͯ‫ͼݺ‬ग़͞ΕΔʢ͢΂ͯͷ‫ͼݺ‬ग़͠‫͕ݩ‬ʮॏཁͰͳ͍

ਤ 3 ʮ੍‫ߏޚ‬จͷ‫܁‬Γฦ͠ʯͷίʔυΫϩʔϯͷྫ

Fig. 3 A code clone including repeated control statements

͚ͱͳΔ͜ͱ͕‫ظ‬଴͞ΕΔɽ

4.2 Ϋϩʔϯ෦෼ͱΫϩʔϯ͕‫·ؚ‬ΕΔϝιουશମͰͷϝιου‫ͼݺ‬ग़͠ͷൺֱ

RQ2 ʹ͍ͭͯௐࠪ͢ΔͨΊʹɼ֤ιϑτ΢ΣΞ͔Β‫ݕ‬ग़͞ΕͨΫϩʔϯηοτʹ͍ͭͯɼʮΫϩʔϯͱͳ͍ͬͯ

ϝιου‫ͼݺ‬ग़͠ʯͰ͋Δ΋ͷʣɼͲͪΒ͔Β΋‫ͼݺ‬ग़͞ΕΔ΋ͷɼҰ౓΋‫ͼݺ‬ग़͞Εͳ͍΋ͷͷ 4 छྨʹ෼ྨͨ͠ɽ
͜͜Ͱͷղੳର৅͸ɼιʔεϑΝΠϧ಺ͷϝιουఆ͓ٛΑͼϝιου‫ͼݺ‬ग़͠ͷΈͰ͋ΔɽͦͷͨΊɼղੳର৅Ҏ֎ͷύοέʔδͳͲ͔Β‫ͼݺ‬ग़͞ΕΔΑ͏ʹઃ‫͞ܭ‬Ε͍ͯΔϝιου͸ʮҰ౓΋‫ͼݺ‬ग़͞Εͳ͍ʯʹ෼ྨ͞ΕΔɽιϑτ΢ΣΞ͝ͱͷ݁ՌΛද 6 ʹࣔ͢ɽ਺ࣈ͸ɼͦΕͧΕ෼ྨ͞Εͨϝιουͷ਺Λද͢ɽද 6 ͔ΒΘ͔Δ௨ΓɼʮৗΔίʔυͷॏཁͳϝιου‫ͼݺ‬ग़͠ͷׂ߹ (C)ʯͱʮΫද 6ϩʔϯ͕ଘࡏ͍ͯ͠ΔϝιουશମͰͷॏཁͳϝιου‫ݺ‬ϝιουͷ෼ྨ

Table 6 Category of methodͼग़͠ͷׂ߹ (D)ʯΛऔಘ͠ɼ෼෍ʹ͕ࠩ͋Δ͔Ͳ͏͔Λ
Software

ৗʹॏཁ

ৗʹॏཁ
Ͱͳ͍

ͲͪΒ͔Β΋
‫ͼݺ‬ग़͞ΕΔҰ౓΋‫ͼݺ‬ग़͞Εͳ͍ʹɼ6 ͭͷιϑτ΢ΣΞத 4 ͭͷιϑτ΢ΣΞͰ͸ɼ༗ҙ

Derby

4,930

5,126

1,312

16,064

ਫ४ 1% Ͱ‫ؼ‬ແԾઆ͸‫غ‬٫͞Εͣɼ(C) ͱ (D) ͷ෼෍ʹࠩ

h2

4,142

6,663

1,995

7,568

jTunes

2,162

4,131

647

3,781

Wilcoxon ͷॱҐ࿨‫ݕ‬ఆʹΑΓ‫ͨ͠ূݕ‬ɽද 5 ʹࣔ͢Α͏͕͋Δͱ͍͏͜ͱ͸Ͱ͖ͳ͍ɽͭ·ΓɼίʔυΫϩʔϯ͕Tomcat

4,202

7,435

1,645

9,158

࡞੒͞ΕΔࡍɼʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯΛଟ͘‫ؚ‬Ή෦

XXL

1,938

2,963

691

4,303

෼ɼ͢ͳΘͪϝιου಺ͷओཁͳॲཧ͕ҙਤతʹબ୒͞Ε

zk

1,411

1,845

538

2,875

c 2013 Information Processing Society of Japan

6

Vol.2013-SE-179 No.15
2013/3/11

৘ใॲཧֶձ‫ڀݚ‬ใࠂ
IPSJ SIG Technical ReportʹॏཁʯɼʮৗʹॏཁͰͳ͍ʯϝιουʹൺ΂ʮͲͪΒ͔Βͳ΋ͷͱ͢ΔͨΊʹɼର৅ͷ‫ޠݴ‬Λ૿΍͢ඞཁ͕͋Δɽ΋‫ͼݺ‬ग़͞ΕΔʯϝιουͷ਺͸গͳ͘ͳ͍ͬͯΔɽ͜ͷ• ϝιου‫ͼݺ‬ग़͠ͷʮมߋ͞Εͨʯͱ͍͏൑அ͸ɼͦ͜ͱ͔Βɼʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯͱʮॏཁͰͳ͍ϝͷ໊લͷΈͰ֬ೝ͓ͯ͠Γɼϝιου໊͕ಉҰͰ͋ͬιου‫ͼݺ‬ग़͠ʯ͕ͦΕͧΕ‫ͼݺ‬ग़͢ϝιου͸͋Δఔ౓ͯ΋࣮ࡍͷଋറઌ͕ҟͳΔՄೳੑʹ͍ͭͯ͸ߟྀͯ͠܏޲͕෼͔Ε͍ͯΔͱਪଌ͞ΕΔɽ

͍ͳ͍ɽJava ͷಈతଋറΛߟྀ͢Δͱɼ2 ͭͷϝιο

4.3.2 ϝιου໊ʹ࢖༻͞ΕΔ୯‫ޠ‬ͷௐࠪυ‫ͼݺ‬ग़໋͠ྩ͕ಉҰͷϝιουΛৗʹ‫ͼݺ‬ग़͢͜ͱ࣍ʹɼʮৗʹॏཁͳϝιου‫ͼݺ‬ग़͠ʹΑͬͯ‫ͼݺ‬ग़͞Ε
ΔʯϝιουͱʮৗʹॏཁͰͳ͍ϝιου‫ͼݺ‬ग़͠ʹΑͬΛਖ਼֬ʹ͸൑ఆͰ͖ͳ͍ͨΊɼຊ‫Ͱڀݚ‬͸໊લͷΈΛ༻͍ͨɽͯ‫ͼݺ‬ग़͞ΕΔʯϝιουɼͦΕͧΕͷϝιου໊ͰΑ͘• ຊ‫Ͱڀݚ‬ର৅ʹͨ͠ίʔυΫϩʔϯ͸ɼCCFinder ͕࢖༻͞Ε͍ͯΔ୯‫͍ͯͭʹޠ‬ௐࠪΛߦͬͨɽํ๏ͱͯ͠

நग़ର৅ͱ͍ͯ͠Δਖ਼‫ن‬Խ͠τʔΫϯྻ͕Ұக͢Δ

͸ɼϝιου໊Λ CamelCase ʹै͍୯‫ʹޠ‬෼ׂ͠ɼઌ಄Ͱ

ιʔείʔυஅยͰ͋ΔɽଞͷίʔυΫϩʔϯ‫ݕ‬ग़࢖༻͞Ε͍ͯΔ୯‫ޠ‬Λू‫ͯ͠ܭ‬ස౓ॱʹฒ΂ସ͑Δ͜ͱͰπʔϧ͕औΓग़͢ίʔυΫϩʔϯʹ͍ͭͯ͸ɼຊ‫ڀݚ‬ௐࠪͨ͠ɽͳ͓ɼௐࠪ͢Δͷ͸ස౓ͷ্Ґ 10 ୯‫ͨ͠ͱޠ‬ɽͷ݁Ռ͕͋ͯ͸·Δͱ͸‫ݶ‬Βͳ͍ɽ·ͣ͸ʮৗʹॏཁͳϝιου‫ͼݺ‬ग़͠ʹΑͬͯ‫ͼݺ‬ग़͞Ε• ຊ‫Ͱڀݚ‬ର৅ʹͨ͠ίʔυΫϩʔϯ͸ɼRNR Λ༻͍

ΔʯϝιουɼʮৗʹॏཁͰͳ͍ϝιου‫ͼݺ‬ग़͠ʹΑͬͯͨϑΟϧλϦϯά‫ޙ‬ͷ΋ͷͰ͋ΔɽRNR ͷ஋͕খ͞‫ͼݺ‬ग़͞ΕΔʯϝιουͦΕͧΕͷ݁ՌΛද 7 ʹࣔ͢ɽ͍ίʔυΫϩʔϯͷଟ͘͸։ൃऀʹͱͬͯҙຯ͕ͳ͍ද 7 Λ‫ݟ‬Δͱ get ΍ is ͳͲͷ୯‫ͪͲ͕ޠ‬Βʹ΋‫·ؚ‬Ε͍ͯΔɽҰํͰͷΈΑ͘࢖༻͞ΕΔ୯‫ޠ‬Λࣔͨ͢ΊɼʮৗʹॏίʔυΫϩʔϯͰ͋Δͱ‫ݴ‬ΘΕ͍ͯΔ͕ɼͦͷཧ༝ʹؔ͢Δௐࠪ͸ຊ‫ʹڀݚ‬͸‫·ؚ‬Ε͍ͯͳ͍ɽ

ཁͳϝιου‫ͼݺ‬ग़͠ʹΑͬͯ‫ͼݺ‬ग़͞ΕΔʯϝιουͱ• ຊ‫Ͱڀݚ‬͸ɼ6 ͭͷΦʔϓϯιʔειϑτ΢ΣΞΛରʮৗʹॏཁͰͳ͍ϝιου‫ͼݺ‬ग़͠ʹΑͬͯ‫ͼݺ‬ग़͞ΕΔʯ৅ʹ࣮‫ݧ‬Λߦͬͨɽ͜ΕΒͷιϑτ΢ΣΞ͸ଟ༷ͳυϝιουͰ‫ڞ‬௨ͯ͠ଘࡏ͢Δ୯‫ʹޠ‬͸ʮɹʯΛҾ͍ͨɽͳϝΠϯʹଐ͍ͯ͠Δͱߟ͍͑ͯΔ͕ɼҟͳΔυϝΠϯ

͓ɼ͜͜Ͱͷʮ‫ڞ‬௨ͯ͠ଘࡏ͢Δ୯‫ޠ‬ʯͱ͸ɼιϑτ΢Σ

ͷιϑτ΢ΣΞ΍ɼ‫Ͱۀا‬։ൃ͞Ε͍ͯΔιϑτ΢Σ

Ξ͕ಉ͔͡Ͳ͏͔Λߟྀ͠ͳ͍ɽͨͱ͑͹ɼॏཁͳϝιοΞͰ͸ɼҟͳΔ܏޲͕ൃ‫͞ݟ‬ΕΔՄೳੑ͕͋Δɽυ‫ͼݺ‬ग़͠ͷ Tomcat ͷ 10 ൪໨ͱॏཁͰͳ͍ϝιου‫ݺ‬• 4.1 અͰ͸ɼ֤ιϑτ΢ΣΞͷίʔυΫϩʔϯ͔Βαϯͼग़͠ͷ zk ͷ 9 ൪໨ʹ do ͱ͍͏୯‫͕ޠ‬ଘࡏ͢Δɽ͜ͷΑϓϧΛऔΓग़ͯ͠ௐࠪΛߦͬͨɽαϯϓϧ਺ͷ૿Ճɼ͏ʹҟͳΔιϑτ΢ΣΞؒͰ‫ڞ‬௨͢Δ୯‫ޠ‬΋আ‫ڈ‬ͷର৅ͱ

͋Δ͍͸ιϑτ΢ΣΞͷมߋʹΑͬͯɼ݁Ռ͕มΘΔ

ͳΔɽ‫ڞ‬௨͢Δ୯‫ޠ‬Λআ͍ͨ͋ͱͷදΛ‫ݟ‬ΔͱɼॏཁͳϝՄೳੑ͸͋Δɽιου‫ͼݺ‬ग़͔͠Β͸ write ΍ removeɼॏཁͰͳ͍ϝιο• ʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯͷநग़ํ๏͸ɼจ‫[ ݙ‬8] Λυ‫ͼݺ‬ग़͔͠Β͸ closeɼto ͳͲ͕ෳ਺ͷιϑτ΢ΣΞʹग़ࢀߟʹͯ͠ಠࣗʹ࡞੒ͨ͠΋ͷͰ͋Δɽจ‫[ ݙ‬8] Ͱධ‫͍ͯ͠ݱ‬Δɽwrite ΍ remove ͸ɼʮॻ͖ग़͢ʯʮআ‫͢ڈ‬Δʯ

Ձ͞Ε͍ͯΔॏཁͳϝιου‫ͼݺ‬ग़͠ͱ͸࣮૷ͷࠩҟͱ͍͏ಈ࡞Ͱ໭Γ஋Λར༻͢Δ͜ͱ͸গͳ͘ɼvoid-returnʹΑΔҧ͍͕ଘࡏ͢ΔՄೳੑ͕͋Δɽ

ʹ֘౰͢Δ͜ͱ͕ଟ͍ͨΊॏཁͳϝιου‫ͼݺ‬ग़͠ʹදΕͨͱਪଌ͞ΕΔɽto ͸ɼtoString ͳͲͷΑ͏ʹ༩͑ΒΕͨ

5. ·ͱΊ

σʔλΛผͷ͔ͨͪʹม‫͢׵‬ΔϝιουͰ࢖༻͞Ε΍͘͢ɼຊ‫Ͱڀݚ‬͸ίʔυΫϩʔϯͱͳ͍ͬͯΔίʔυ͕࣋ͭಛม‫ޙ׵‬ͷσʔλ͕໭Γ஋ͱͯ͠ར༻͞Ε͍ͯͨͨΊʮॏཁ௃Λௐࠪ͢ΔͨΊɼͦͷϝτϦΫεΛ‫ܭ‬ଌ͠ɼ෼ੳΛߦͬͳϝιου‫ͼݺ‬ग़͠ʯͱͳΒͣɼॏཁͰͳ͍ϝιου‫ͼݺ‬ͨɽͦͷ݁Ռɼʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯ͸ͦ͏Ͱͳ͍

ग़͠ʹදΕͨͱਪଌ͞ΕΔɽclose ͸ɼ3 ষͰఆٛͨ͠Α͏ϝιου‫ͼݺ‬ग़͠ʹൺ΂໊ͯલͷमਖ਼͕Ճ͑ΒΕʹ͘͘ɼʹ͜ͷ୯‫࢖͕ޠ‬ΘΕͨϝιουͷ‫ͼݺ‬ग़͠͸ ending Ҏ֎CCFinder Ͱ‫ݕ‬ग़͞ΕͨίʔυΫϩʔϯͷଟ͘͸ɼࡉ͔͍Ͱ͸ʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯͷީิ͔Βআ‫͞ڈ‬ΕΔͨ

ࠩҟ͸͋Δ͕ɼͦͷग़‫ݱ‬ҐஔͰ͋ΔϝιουͷதͰ୲౰͠

Ίɼͦͷଟ͕͘ʮॏཁͰͳ͍ϝιου‫ͼݺ‬ग़͠ʯͱ෼ྨ͞

͍ͯΔॏཁͳॲཧͷ಺༰͸͋·ΓมΘΒͳ͍͜ͱ͕෼͔ͬ

ΕɼॏཁͰͳ͍ϝιου‫ͼݺ‬ग़͠ʹදΕͨͱߟ͑ΒΕΔɽ

ͨɽʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯ͕มߋ͞Ε͍ͯͳ͍ίʔυΫϩʔϯͷଟ͘͸ɼಉҰύοέʔδ಺෦ɼ͋Δ͍͸ྨࣅ͠

4.4 ௐࠪ݁Ռͱͦͷଥ౰ੑຊ‫͚͓ʹڀݚ‬Δௐࠪͷଥ౰ੑʹ͍ͭͯ஫ҙ͢΂͖఺ΛҎԼʹ·ͱΊΔɽ໊ͨલͷΫϥεͳͲʹग़‫͓ͯ͠ݱ‬ΓɼಛఆͷॲཧΛΫϥεؒɼϝιουؒͰ‫ڞ‬༗͢Δํ๏͕ͳ͍ͨΊʹ࡞ΒΕ͍ͯΔ
ͷͩͱߟ͑ΒΕΔɽҰํɼʮॏཁͳϝιου‫ͼݺ‬ग़͠ͷม• ຊ‫ڀݚ‬͸ Java Ͱ‫ه‬ड़͞Εͨιʔείʔυʹ͍ͭͯͷΈߋ౓߹ʯͷߴ͍ίʔυΫϩʔϯ͸੍‫ߏޚ‬଄ͷ࠶ར༻ʹΑΔ

ௐࠪΛߦͬͨɽจ๏‫ن‬ଇͷҟͳΔଞͷ‫Ͱޠݴ‬͸ҧͬͨ΋ͷͰ͋Δͱߟ͑ΒΕΔ͕ɼ
ʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯ͕܏޲͕‫ݟ‬ΒΕΔ͔΋͠Εͳ͍ɽௐࠪ݁ՌΛΑΓҰൠతมߋ͞Ε͍ͯͳ͍ίʔυΫϩʔϯ͸શମͷ 87%Λ઎Ί͍ͯc 2013 Information Processing Society of Japan

7

Vol.2013-SE-179 No.15
2013/3/11

৘ใॲཧֶձ‫ڀݚ‬ใࠂ
IPSJ SIG Technical Reportද 7 ʮৗʹॏཁͳϝιου‫ͼݺ‬ग़͠ʹΑͬͯ‫ͼݺ‬ग़͞ΕΔϝιουʯɼʮৗʹॏཁͰͳ͍ϝιου‫ͼݺ‬ग़͠ʹΑͬͯ‫ͼݺ‬ग़͞ΕΔϝιουʯͷ໊લʹ࢖ΘΕΔ୯‫ޠ‬

Table 7 Words in method names which appear in “important” calls and “not important” callsʮৗʹॏཁʯϝιουͰසग़

Derby

h2

jTunesTomcatʮৗʹॏཁͰͳ͍ʯϝιουͰසग़

XXL

zk

Derby

h2

jTunesTomcat

XXL

zk

1

get

get

add

get

get

get

get

get

get

get

get

get

2

updateadd

decode

add

write

add

set

set

set

set

set

set

3

is

is

get

is

read

is

close

close

create

is

close

is

4

read

read

createremoveupdate

parse

is

is

is

close

is

to

5

init

write

paint

createopen

remove

new

add

name

create

to

add

6

add

check

removewrite

removeon

setup

createcontains

ﬁnd

has

new

7

write

remove

is

jj

has

render

has

debug

close

log

print

resolve

8

check

parse

draw

parse

is

new

to

read

add

to

read

append

9

set

init

install

run

add

set

make

log

to

read

index

do

10

bind

create

init

do

next

has

ﬁnd

to

read

add

size

parse

Δ͜ͱ͔ΒɼίʔυΫϩʔϯͷଟ͕͘ϝιου‫ͼݺ‬ग़͠ʹΑ࣮ͬͯ‫͞ݱ‬Ε͍ͯΔॲཧͷ࠶ར༻Ͱ͋Δͱߟ͑ΒΕΔɽ
͜ΕΒͷࣄ࣮͸ɼCCFinder ͷίʔυΫϩʔϯ‫ݕ‬ग़ͷख๏

[7]͔Β͸௚઀໌Β͔ʹͳ͍ͬͯͳ͔ͬͨੑ࣭Ͱ͋Γɼͦͷ֬ೝΛߦͬͨ͜ͱ͕ɼຊ‫ڀݚ‬ͷߩ‫͋Ͱݙ‬Δɽࠓ‫ޙ‬ͷ՝୊ͱͯ͠͸ɼର৅ιϑτ΢ΣΞͷ਺΍छྨΛ૿΍ͨ͠Γɼର৅‫ޠݴ‬Λ૿΍͢͜ͱͰࠓճͷ෼ੳ݁ՌͷҰൠ

[8]ੑΛ֬ೝ͢Δ͜ͱ͕‫͛ڍ‬ΒΕΔɽ·ͨɼʮॏཁͳϝιου‫ͼݺ‬ग़͠ʯʹ͍ͭͯͷௐࠪΛߦ͏͜ͱͰɼιϑτ΢ΣΞશମʹ͓͚ΔʮॏཁͳॲཧʯͱΫϩʔϯͱͷؔΘΓΛௐ΂͍ͯ͘͜ͱ΋ߟ͑ΒΕΔɽ

[9]ँࣙ ຊ‫ڀݚ‬͸ɼ೔ຊֶज़ৼ‫ڵ‬ձՊֶ‫ڀݚ‬අิॿۚएख
‫( ڀݚ‬A)ʢ՝୊൪߸:23680001ʣͷॿ੒Λಘͨɽࢀߟจ‫ݙ‬
[1]

[2]

[3]

[4]

[5]

[6]

[10]

Merlo, E.: Comparison and Evaluation of Clone Detection Tools, IEEE Transactions on Software Engineering, Vol. 33, No. 9, pp. 577–591 (2007).
Jiang, L., Misherghi, G., Su, Z. and Glondu, S.:
DECKARD: Scalable and Accurate Tree-Based Detection of Code Clones, Proceedings of the 29th International Conference on Software Engineering, pp. 96–105(2007).
Sridhara, G., Hill, E., Muppaneni, D. and Pollick, L.:
Towards Automatically Generating Summary Comments
for Java Methods, Proceedings of the 25th IEEE/ACM
International Conference on Automated Software Engineering, pp. 43–52 (2010).
Higo, Y., Kamiya, T., Kusumoto, S., and Inoue, K.:
Method and Implementation for Investigating CodeClones in a Software System, Information and Software
Technology, Vol. 49, No. 9-10, pp. 985–998 (2007).
Horwitz, S., Reps, T. and Binkley, D.: Interprocedural
Slicing Using Dependence Graphs, ACM Transactions
on Programming Languages and Systems, Vol. 12, No. 1,
pp. 26–60 (1990).

Kamiya, T., Kusumoto, S. and Inoue, K.: CCFinder: A
Multi-Linguistic Token-based Code Clone Detection System for Large Scale Source Code, IEEE Transactions
on Software Engineering, Vol. 28, No. 7, pp. 654–670(2002).
Tarr, P., Ossher, H., Harrison, W. and Sutton, Jr., S. M.:
N degrees of separation: multi-dimensional separation ofconcerns, Proceedings of the 21st ACM/IEEE International Conference on Software Engineering, pp. 107–119(1999).
Kim, M., Bergman, L., Lau, T. and Notkin, D.: An
Ethnographic Study of Copy and Paste Programming
Practices in OOPL, Proceedings of the 3rd International
Symposium on Empirical Software Engineering, pp. 83–
92 (2004).
Juergens, E., Deissenboeck, F. and Hummel, B.: Code
Similarities Beyond Copy and Paste, Proceedings of the
14th IEEE European Conference on Software Maintenance and Reengineering, pp. 78–87 (2010).
Roy, C. K. and Cordy, J. R.: Scenario-Based Comparison of Clone Detection Techniques, Proceedings of the
16th IEEE International Conference on Program Comprehension, pp. 153–162 (2008).
Bellon, S., Koschke, R., Antoniol, G., Krinke, J. andc 2013 Information Processing Society of Japan

8