ソフトウェアエンジニアリングシンポジウム 2015
IPSJ/SIGSE Software Engineering Symposium (SES2015)‫ۀ‬຿γεςϜཧղͷͨΊͷ֎෦γεςϜͱͷೖग़ྗΛ༻͍ͨΫϥελϦϯάख๏ਇ໺ ஐਉ1,a)ੴඌ ོ1,b)ࢣ ๕୎2,c)ࡔా ༞࢘2,d)Ҫ্ ࠀ࿠1,e)֓ཁɿ਺े೥Ҏ্લʹ։ൃ͞Εͨ‫ۀ‬຿༻ͷ৘ใγεςϜ͸ɼ‫ݱ‬୅Ͱ΋ॏཁͳ໾ׂΛՌ͍ͨͯ͠Δɽ͜ͷΑ͏ͳ‫͍ݹ‬γεςϜ͸େ‫ن‬໛͔ͭෳࡶͰ͋Γɼอकੑͱੜ࢈ੑ͕௿Լ͍ͯ͠Δ͜ͱ͕ଟ͍͜ͱ͔Βɼࠓ‫ޙ‬ͷอक࡞‫ʹۀ‬దͨ͠ߏ଄΁ͱ࠶ઃ‫͢ܭ‬Δ͜ͱ͕ॏཁͱͳ͍ͬͯΔɽ͔͠͠ɼ‫͍ݹ‬γεςϜͰ͸ιʔείʔυ͕͏·͘੔ཧ͞Ε͓ͯΒͣɼιʔείʔυதͷࣝผࢠʹͦͷ໾ׂΛද͢Α͏ͳ໊લ͕෇͚ΒΕ͍ͯͳ͍͜
ͱ͔Βɼͦͷߏ଄Λཧղ͢Δ͜ͱ͕ࠔ೉Ͱ͋Δɽͦ͜Ͱຊ‫Ͱڀݚ‬͸ɼࣝผࢠΛར༻ͤͣʹɼιʔείʔυதͷؔ਺Λಈ࡞ͷྨࣅੑʹΑͬͯ෼ྨ͢ΔΫϥελϦϯάख๏ΛఏҊ͢Δɽख๏ʹΑͬͯ‫ܗ‬੒͞ΕͨΫϥελʹ‫·ؚ‬ΕΔ͋Δ 1 ͭͷؔ਺Λཧղ͢Ε͹ɼಉ͡Ϋϥελʹଐ͢Δؔ਺Λཧղ͢Δࡍʹɼͦͷ஌͕ࣝར
༻Ͱ͖Δͱߟ͑ΒΕΔɽఏҊख๏͸ɼγεςϜͷૢ࡞ը໘΍σʔλϕʔε΁ͷΞΫηεͱ͍ͬͨ‫ۀ‬຿γεςϜͷ‫ج‬ຊతͳ໋ྩΛ֤ؔ਺͔Βநग़͠ɼͦͷ໋ྩྻͷྨࣅ౓ʹΑͬͯಈ࡞͕ྨࣅͨؔ͠਺Λ‫ݕ‬ग़͢Δɽ
ख๏ΛධՁ͢ΔͨΊʹɼ2 ͭͷ Java γεςϜʹରͯ͠ద༻࣮‫ݧ‬Λߦͬͨɽͦͷ݁ՌɼఏҊख๏͸ɼਓखʹΑΔΫϥελϦϯάʹ͍ۙΫϥελϦϯάΛߦ͑Δ͜ͱΛࣔͨ͠ɽ

Understanding Business System through Software Clustering
Using I/O Instructions for External Systems
Abstract: Business systems written decades ago play a key role in modern society. The maintenance of thesesystems requires a huge eﬀort because they are typically large-scale and complicated. System modernization
is important to facilitate the maintenance task of a legacy system. However, understanding a system for its
modernization is a diﬃcult task; one of the main reasons is that identiﬁer names in the legacy code do not
represent their roles. This paper proposes a software clustering technique which groups functions in sourcecode by similarity of their actions without using identiﬁer names. The technique can provide a beneﬁt: if adeveloper understands a function included in a cluster, the developer can easily understand other functions
included in the same cluster. This technique extracts a sequence of input/output instructions for a databaseand a user interface from each function to detect similar functions. An experiment for two Java systems
showed that the clustering results by the technique resemble those by a developer.

1. ͸͡Ίʹ

ଟ͘ଘࡏ͓ͯ͠Γɼ‫ܧ‬ଓతͳ‫ػ‬ೳ௥Ճ΍࢓༷มߋʹΑΓɼγεςϜͷେ‫ن‬໛ԽͱෳࡶԽ͕ਐΈɼอकඅ༻ͷ૿ՃΛট‫ࡏݱ‬ɼଟ͘ͷ૊৫͕‫ۀ‬຿Λ਱ߦ͢ΔͨΊͷ৘ใγεςϜɼ

͍͍ͯΔ [1]ɽͦͷͨΊɼγεςϜΛϢʔβͷཁ‫ٻ‬ͷมԽ͢ͳΘͪ‫ۀ‬຿γεςϜΛར༻͍ͯ͠Δɽ‫ۀ‬຿γεςϜͷதʹ߹Θͤͯਝ଎ʹมߋ͍ͯ͘͜͠ͱ΋ࠔ೉ͱͳ͍ͬͯΔɽʹ͸ɼ਺े೥Ҏ্લ͔Βอक։ൃ͕ଓ͚ΒΕ͍ͯΔ΋ͷ΋͜ͷΑ͏ͳ໰୊Λղܾ͢ΔͨΊʹɼ‫ߦݱ‬ͷγεςϜͷߏ଄

1

2
a)
b)
c)
d)
e)

େࡕେֶେֶӃ৘ใՊֶ‫ڀݚ‬ՊGraduate School of Information Science and Technology, Osaka University‫ࣜג‬ձࣾ NTT σʔλNTT DATA Corporation
t-hatano@ist.osaka-u.ac.jp
ishio@ist.osaka-u.ac.jp
moroys@nttdata.co.jp
sakatayu@nttdata.co.jp
inoue@ist.osaka-u.ac.jp

c 2015 Information Processing Society of Japan⃝Λ෼ੳ͠ɼࠓ‫ޙ‬ͷ৽‫ػ‬ೳͷ௥Ճ΍อक࡞‫ʹۀ‬దͨ͠ߏ଄΁ͱ࠶ઃ‫͢ܭ‬Δ͜ͱ͕ॏཁͱͳ͍ͬͯΔɽ
γεςϜͷߏ଄Λཧղ͢ΔࡍʹΑ͘໰୊ʹͳΔͷ͕ɼγεςϜͷઃ‫͞࢒͕ॻܭ‬Ε͍ͯͳ͍͜ͱɼ΋͋ͬͯ͠΋ɼ࠷৽ͷঢ়ଶ͕‫ه‬ड़͞Ε͍ͯͳ͍৔߹͕ଟ͍͜ͱͰ͋Δ [2]ɽର৅γεςϜͷอक։ൃΛߦ͍ͬͯΔ։ൃऀ͕͍Δ৔߹Ͱ΋ɼ࠷ۙͷมߋ఺͔͠ཧղ͓ͯ͠ΒͣɼγεςϜશମͷߏ

17

ソフトウェアエンジニアリングシンポジウム 2015
IPSJ/SIGSE Software Engineering Symposium (SES2015)଄΍ಈ࡞·Ͱ͸೺Ѳ͍ͯ͠ͳ͍͜ͱ͕͋Δɽ͜Ε͸ଟ͘ͷ͚‫·ؚ‬Ε͍ͯΔ͔ͰɼαϒγεςϜ಺෦ͷ‫ػ‬ೳͷ਺ΛਪଌϓϩάϥϜཧղͷ‫͚͓ʹڀݚ‬Δ‫ڞ‬௨ͷ՝୊Ͱ͋Δ͕ɼ‫͍ݹ‬

͢Δ͜ͱ͕Ͱ͖Δɽ‫ۀ‬຿γεςϜͷߏ଄Λཧղ͢Δ࡞‫͍͓ͯʹۀ‬͸ɼ͞Βʹ࣍۩ମతͳख๏ͱͯ͠͸ɼϓϩάϥϜͷ֤ؔ਺ΛɼγεςͷΑ͏ͳ೉͕͠͞ՃΘΔɽ

Ϝͷૢ࡞ը໘΍σʔλϕʔε΁ͷΞΫηεͱ͍ͬͨ‫ۀ‬຿γ( 1 ) ϑΝΠϧ͕σΟϨΫτϦʹద੾ʹ෼ׂ͞Ε͍ͯͳ͍ɽ

εςϜʹ‫ڞ‬௨͢Δ໋ྩͷྻͰද‫͢ݱ‬Δɽͦͯ͠ɼϓϩάϥ‫ݱ‬୅ͷγεςϜ։ൃʹ͓͚Δओཁ‫͋Ͱޠݴ‬Δ Java ͰϜͷ֤ؔ਺Λ௖఺ɼؔ਺ͷ໋ྩྻͷྨࣅ౓ΛॏΈͱͨ͠ล͸ύοέʔδߏ଄Λ༻͍ͯιʔείʔυΛ֊૚తʹΛ࣋ͭάϥϑΛ࡞੒͠ɼີ઀ʹؔ࿈ͨ͠௖఺ͷάϧʔϓΛ

੔ཧ͢Δ͜ͱ͕ҰൠతͰ͋Δ͕ɼ։ൃ౰࣌ʹ͸ͦͷΑ‫ݕ‬ग़͢ΔΫϥελϦϯάΞϧΰϦζϜΛద༻͢Δ͜ͱͰɼ͏ͳ࢓૊Έ͕ར༻͞Ε͓ͯΒͣɼγεςϜͷ͢΂ͯͷྨࣅ౓ͷߴ͍ؔ਺ΛΫϥελͱͯ͠·ͱΊΔɽϑΝΠϧ͕̍ͭͷσΟϨΫτϦʹଘࡏ͓ͯ͠ΓɼγεςϜશମͷߏ଄͕෼͔Βͳ͘ͳ͍ͬͯΔɽఏҊख๏ΛධՁ͢ΔͨΊʹɼJava Ͱॻ͔ΕͨγεςϜʹର͢Δ࣮૷Λߦ͍ɼద༻࣮‫ݧ‬Λߦͬͨɽ2 ͭͷγεςϜ

( 2 ) ࣝผࢠͱͯ͠ɼઃ‫ػʹ࣌ܭ‬ցతʹׂΓ౰ͯͨจࣈྻ

Λର৅ͱͯ͠ɼͦΕΒͷϝιου໊ͳͲΛࢀরͯ͠ख࡞‫ۀ‬ʢͨͱ͑͹ FUNC0001ɼFUNC0002ɼ· · · ͷΑ͏ͳ࿈Ͱ࡞੒ͨ͠ΫϥελΛਖ਼ղͱΈͳͯ͠ɼख๏Λద༻ͨ݁͠

൪ʣͳͲɼ‫ػ‬ೳͱແؔ܎ͳ໊લ͕࢖༻͞Ε͍ͯΔ [3]ɽՌಘΒΕͨΫϥελΛධՁͨ͠ɽ·ͨɼఏҊख๏ʹΑΔΫ‫Ͱࡏݱ‬͸ɼιʔείʔυதͷࣝผࢠʹͦͷ໾ׂΛද͢ϥελϦϯά͕ɼ‫ط‬ଘ‫ߦͰڀݚ‬ΘΕ͍ͯΔ‫౓߹݁ͱ౓ूڽ‬໊લΛ෇͚Δ͜ͱ͕ओு͞Ε͍ͯΔ [4] ͕ɼ౰࣌͸ͦʹ‫ͮ͘ج‬ΫϥελϦϯάͱ͸ҟͳΔ͜ͱΛ֬ೝ͢ΔͨΊͷΑ͏ͳࣝผࢠ͸ར༻͞Ε͓ͯΒͣɼ໊લ͔Βͦͷ໾ʹɼؔ਺ͷ‫ͼݺ‬ग़ؔ͠܎ʹΑΔΫϥελϦϯάͱͷൺֱΛׂ΍‫ػ‬ೳΛਪଌ͢Δ͜ͱ͕೉͍͠ɽ

ߦͬͨɽ͜ͷ͏ͪɼલऀͷ໰୊ʹରͯ͠͸ɼιϑτ΢ΣΞΫϥε

Ҏ߱ɼ2 ষͰ͸‫ط‬ଘͷΫϥελϦϯάख๏ͱͦͷؔ࿈ٕλϦϯά͕ఏҊ͞Ε͍ͯΔɽιϑτ΢ΣΞΫϥελϦϯά

ज़Ͱ͋ΔιʔείʔυͷྨࣅੑΛೝࣝ͢Δख๏ʹ͍ͭͯड़͸ɼγεςϜͷιʔείʔυͷߏ੒ཁૉʢϑΝΠϧ΍ؔ਺΂Δɽ3 ষͰ͸ఏҊख๏Λड़΂ɼ4 ষͰ͸ख๏Λద༻ͨ͠ͳͲʣΛԿΒ͔ͷ‫ࣅྨͮ͘جʹ఺؍‬ੑʹΑͬͯ෼ྨ͢ΔٕධՁ࣮‫͍ͯͭʹݧ‬ड़΂Δɽ5 ষͰ͸ख๏ͷ࣮༻Խʹ޲͚ͨज़Ͱ͋ΓɼγεςϜΛ෼ׂͯ͠ෳࡶ౓ΛԼ͛Δ͜ͱͰେ‫ن‬ٞ࿦Λߦ͍ɼ࠷‫ ʹޙ‬6 ষͰ·ͱΊͱࠓ‫ޙ‬ͷ՝୊Λड़΂Δɽ໛γεςϜͷཧղΛࢧԉ͢Δ [5]ɽ͜Ε·ͰఏҊ͞Ε͍ͯΔ
ଟ͘ͷख๏͸ɼϑΝΠϧؒͷґଘؔ܎΍ࣝผࢠͷྨࣅ౓ʹ‫͍ͯͮج‬ɼγεςϜΛ‫౓߹݁͘ߴ͕౓ूڽ‬ͷ௿͍αϒγε2. എ‫ܠ‬2.1 ιϑτ΢ΣΞΫϥελϦϯά

ςϜʹ෼ྨ͢Δ͜ͱΛ໨తͱ͍ͯ͠Δ [6]ɽKobayashi Βιϑτ΢ΣΞΫϥελϦϯάͱ͸ɼγεςϜͷιʔε͸ɼΫϥελϦϯάͷ݁Ռʹ‫͍ͯͮج‬γεςϜͷߏ଄ΛՄίʔυͷߏ੒ཁૉʢϑΝΠϧ΍ؔ਺ͳͲʣΛɼԿΒ͔ͷ‫؍‬ࢹԽ͠ɼ‫ط‬ଘγεςϜͷߏ଄෼ੳΛࢧԉ͢Δख๏ΛఏҊ͠఺ʹ‫ࣅྨͮ͘ج‬ੑʹΑͬͯ෼ྨ͢Δٕज़Ͱ͋Δɽιϑτ͍ͯΔ [7]ɽ

΢ΣΞΫϥελϦϯάͰ͸ɼ·ͣɼιʔείʔυͷߏ੒ཁγεςϜͷߏ଄ͷ෼ੳ͕‫͞ڀݚʹൃ׆‬Ε͍ͯΔҰํͰɼૉ͔Β͋Δಛ௃Λநग़͠ɼཁૉؒͷؔ࿈Λ਺஋Խ͢Δɽͦ‫ऀޙ‬ͷ໰୊΁ͷରԠࡦ͸ఏ‫͞ڙ‬Ε͍ͯͳ͍ɽͨͱ͑͹ɼͯ͠ɼ‫ػ‬ցֶशʹ͓͍ͯར༻͞Ε͍ͯΔΫϥελϦϯάΞ

Kobayashi ΒͷՄࢹԽख๏ [7] Ͱ͸ɼΫϥελʹׂΓ౰ͯϧΰϦζϜΛద༻͠ɼؔ࿈ͷ‫͍ڧ‬ཁૉΛ 1 ͭͷΫϥελͱΔΩʔϫʔυͱͯ͠ɼύοέʔδ໊΍Ϋϥε໊Λ࢖༻ͯͯ͠͠·ͱΊΔɽΫϥελϦϯάͷ݁Ռ͸ɼγεςϜͷߏ଄͓Γɼ‫ػ‬ೳͳͲΛද‫͢ݱ‬Δࣝผࢠ͕෇͚ΒΕ͍ͯͳ͍‫͍ݹ‬Λ෮‫ͨ͠ݩ‬Γɼߏ଄ͷվળ఺Λൃ‫ͨ͠ݟ‬Γ͢ΔͨΊʹ࢖Θ‫ۀ‬຿γεςϜͷ෼ੳʹͦͷ··ద༻͢Δ͜ͱ͕೉͍͠ɽΕ͍ͯΔ [6], [7]ɽMitchell Β͸ɼΫϥελϦϯάΛ༻͍ͯຊ‫Ͱڀݚ‬͸ɼࣝผࢠʹҙຯͷ͋Δ໊લ͕༩͑ΒΕ͍ͯͳՄࢹԽͨ͠γεςϜͷߏ଄͕ɼอक։ൃऀʹͱͬͯ༗༻Ͱ

͍‫ۀ‬຿γεςϜʹ͓͍ͯɼؔ਺ʢJava ͷ৔߹͸ϝιουʣ

͋Δ͜ͱΛ͍ࣔͯ͠Δ [8]ɽ͜Ε·Ͱʹɼ༷ʑͳΫϥελΛͦͷಈ࡞ͷྨࣅੑʹ‫͍ͯͮج‬෼ྨ͢ΔΫϥελϦϯάखϦϯάख๏͕ఏҊ͞Ε͖͕ͯͨɼͦΕͧΕͷ໨తʹԠͨ͡๏ΛఏҊ͢Δɽ‫ۀ‬຿γεςϜͰ͸ɼࣾһ৘ใ΍ࡏ‫ݿ‬৘ใͱಛ௃ͷநग़ํ๏͕༻͍ΒΕ͍ͯΔɽ

͍༷ͬͨʑͳ‫ۀ‬຿͝ͱͷσʔλʹ͍ͭͯɼొ࿥ɼ‫ࡧݕ‬ɼߋ

Mancoridis Β͸ɼؔ਺ͷ‫ͼݺ‬ग़ؔ͠܎΍ม਺ͷࢀরؔ৽ɼ࡟আͳͲͷྨࣅͨ͠ಈ࡞͕࣮૷͞Ε͍ͯΔ͜ͱ͕ଟ͍ɽ

܎ΛϑΝΠϧؒͷґଘؔ܎ͱͯ͠நग़͠ɼର৅γεςϜΛ

ͦͷͨΊɼѻ͏σʔλ͸ҟͳΔ͕ྨࣅͨ͠ಈ࡞Λ͢Δؔ਺

‫౓߹݁͘ߴ͕౓ूڽ‬ͷ௿͍αϒγεςϜʹ෼ྨ͢Δ͜ͱΛΛ·ͱΊΔ͜ͱͰɼू߹ʹ‫·ؚ‬ΕΔ̍ͭͷؔ਺Λཧղ͢Ε໨తͱ͍ͯ͠Δ [9]ɽαϒγεςϜʹ෼ྨ͢Δ͜ͱʹΑͬ͹ɼಉ͡ू߹ʹଐ͢Δଞͷؔ਺Λཧղ͢Δࡍʹɼͦͷ஌ࣝͯγεςϜͷෳࡶ౓ΛԼ͛ɼγεςϜͷߏ଄ཧղΛࢧԉ͕͠ར༻Ͱ͖Δͱߟ͑ΒΕΔɽ·ͨɼ‫ط‬ଘͷΫϥελϦϯά

͍ͯΔɽ[10] Ͱ͸ɼΑ͘࢖ΘΕΔϥΠϒϥϦؔ਺ͷ૊߹ͤख๏Ͱ‫ۀ‬຿ʹରԠ͢ΔαϒγεςϜ͕ಘΒΕ͍ͯΕ͹ɼͦʢΠσΟΦϜʣΛ‫ݕ‬ग़͢ΔͨΊʹɼؔ਺ͷ‫ͼݺ‬ग़ؔ͠܎ΛґͷαϒγεςϜʹҟͳΔಈ࡞Λද‫ͨ͠ݱ‬Ϋϥελ͕ͲΕͩଘؔ܎ͱͯ͠நग़͍ͯ͠Δɽ͔͠͠ɼґଘؔ܎ʹΑΔΫϥ

c 2015 Information Processing Society of Japan⃝18

ソフトウェアエンジニアリングシンポジウム 2015
IPSJ/SIGSE Software Engineering Symposium (SES2015)ελϦϯά͸ɼ༷ʑͳؔ਺͔Β‫ͼݺ‬ग़͞ΕΔؔ਺͕ଘࡏ͢

ͨɼίʔυΫϩʔϯ‫ݕ‬ग़ʹ͓͚Δओͳ໨త͸ɼྨࣅॲཧͷΔ৔߹ɼΫϥελϦϯά݁ՌΛ։ൃऀ͕खಈͰચ࿅͢Δඞ

ू໿΍Ϋϩʔϯͱͳ͍ͬͯΔෳ਺ͷίʔυยʹର͢ΔҰ؏ཁ͕͋Δͱ͍͏໰୊͕͋ͬͨ [11]ɽͦ͜ͰɼͦͷΑ͏ͳؔͨ͠मਖ਼Λߦ͏ͱ͍͏࡞‫ۀ‬Λࢧԉ͠ɼϓϩάϥϜͷอकੑ਺Λআ‫͢ڈ‬Δख๏΍ɼͦͷӨ‫ڹ‬Λܰ‫͢ݮ‬Δख๏͕ఏҊ͞ΕΛ޲্ͤ͞Δ͜ͱͰ͋ΔɽͦͷͨΊɼίʔυΫϩʔϯ‫ݕ‬ग़͍ͯΔ [12]ɽKobayashi Β͸ɼ[12] ͷख๏Λ༻͍ͯγεςͰ͸͋Δఔ౓௕͍ίʔυยͷ‫ݕ‬ग़Λߦ͏͕ɼຊ‫Ͱڀݚ‬͸ɼϜͷߏ଄ΛՄࢹԽ͠ɼߏ଄ͷཧղΛࢧԉ͢Δख๏ΛఏҊ͠୹͍ؔ਺Ͱ͋ͬͯ΋ಈ࡞͕ྨࣅ͍ͯ͠Ε͹ಉ͡Ϋϥελͱ͍ͯΔ [7]ɽ

ͯ͠ೝࣝ͢Δඞཁ͕͋Δɽ͞ΒʹɼίʔυΫϩʔϯ‫ݕ‬ग़Ͱιʔείʔυதͷࣝผࢠͷྨࣅੑʹ‫ͮ͘ج‬ΫϥελϦϯ

͸ɼσʔλϕʔεΛૢ࡞͢Δલ‫Ͱޙ‬ͷΤϥʔॲཧͱ͍ͬͨ

άख๏΋ఏҊ͞Ε͍ͯΔɽAnquetil Β͸ɼࣝผࢠʹ‫·ؚ‬Εಈ࡞ͷछྨʹؔ܎ͳ͘ߦΘΕΔॲཧΛΫϩʔϯͱͯ͠‫ݕ‬ग़Δ୯‫ޠ‬ͷྨࣅ౓Λ༻͍ͨΫϥελϦϯά͕༗༻Ͱ͋Δ͜ͱͯ͠͠·͍ɼҟͳΔ‫ػ‬ೳ಺Ͱಉ༷ͷॲཧ͕ߦΘΕ͍ͯΔؔ

Λ͓ࣔͯ͠Γ [13]ɼAndritsos Β͸ɼ୯‫ޠ‬ͷग़‫ݱ‬ස౓ʹΑ਺Λྨࣅ͍ͯ͠Δͱ൑ఆͯ͠͠·͏Մೳੑ͕͋Δɽ͜ΕΒΔॏΈΛߟྀ͢Δ͜ͱ͕ॏཁͰ͋Δ͜ͱΛ͍ࣔͯ͠Δ [14]ɽ

ͷॲཧ͸ɼؔ਺ͷಈ࡞ͷಛ௃Λද͢΋ͷͰ͸ͳ͍ͨΊɼຊ·ͨɼAnquetil Β͸ɼϑΝΠϧ໊ͷ໋໊‫ن‬ଇΛ༻͍ͨΫϥ‫Ͱڀݚ‬͸͜ΕΒͷॲཧͷྨࣅੑΛແࢹ͢Δඞཁ͕͋Δɽ

ελϦϯάख๏ΛఏҊ͍ͯ͠Δ [15]ɽ͜ΕΒͷख๏͸ࣝผ

2.2.2 ྨࣅͨ͠ΞϓϦέʔγϣϯͷ‫ݕ‬ग़ࢠʹͦͷ໾ׂΛද໊͢લ͕෇͚ΒΕ͍ͯΔ৔߹ɼ༗༻Ͱ͋
Δͱߟ͑ΒΕΔɽ

McMillan Β͸ɼιʔείʔυͷ࠶ར༻Λޮ཰తʹߦ͏ͨΊʹɼྨࣅͨ͠ Java ΞϓϦέʔγϣϯΛ‫ݕ‬ग़͢Δख๏

Scanniello Β͸ɼΦϒδΣΫτࢦ޲‫͔ॻͰޠݴ‬ΕͨγεΛఏҊ͍ͯ͠Δ [19]ɽ͜ͷख๏Ͱ͸ɼಉ͡ύοέʔδ΍ಉςϜΛର৅ʹɼΫϥεͷ‫ܧ‬ঝؔ܎ͱΠϯλʔϑΣʔεͷ࣮͡Ϋϥεʹଐ͢ΔϝιουΛ‫ͼݺ‬ग़͍ͯ͠ΔΞϓϦέʔ૷ؔ܎Λ༻͍ͨΫϥελϦϯάख๏ΛఏҊ͍ͯ͠Δ [16]ɽ

γϣϯΛྨࣅͨ͠ΞϓϦέʔγϣϯͱͯ͠‫ݕ‬ग़͍ͯ͠Δɽ͜ͷख๏͸ɼΫϥΠΞϯταʔόγεςϜͰΑ͘༻͍ΒΕ͜ͷ‫ݕ‬ग़ํ๏͸ɼಉ͡ API Λར༻͢Δ΋ͷ͸ࣅ͍ͯΔΞϓΔ֊૚ԽΞʔΩςΫνϟͷ૚ߏ଄Λೝࣝ͢ΔͨΊʹɼΦϒϦέʔγϣϯͰ͋Δͱ͍͏ߟ͑ํʹ‫͍͍ͯͮج‬Δɽ·ͨɼδΣΫτࢦ޲‫ޠݴ‬ͷಛ௃Λར༻͓ͯ͠Γɼೝࣝ͞Εͨ૚͜͝ͷख๏͸ɼύοέʔδ΍Ϋϥεͱ͍ͬͨ֓೦Ͱ੔ཧ͞ΕͱʹࣝผࢠͷྨࣅੑʹΑΔΫϥελϦϯάΛద༻͍ͯ͠Δɽ

ͨΞϓϦέʔγϣϯ͕Φʔϓϯιʔεͱͯ͠਺ଟ͘ެ։͞

Tzerpos Β͸ɼେ‫ن‬໛γεςϜͰΑ͘‫ݟ‬ΒΕΔύλʔϯʹ‫ͮ͘ج‬ΫϥελϦϯάख๏ΛఏҊ͍ͯ͠Δ [17]ɽ͜ͷख๏ʹ͓͚Δύλʔϯͱ͸ɼͨͱ͑͹ɼC ‫͔ॻͰޠݴ‬ΕͨγΕ͍ͯΔ͜ͱΛར༻͍ͯ͠Δɽ

3. ఏҊख๏

εςϜʹ͓͍ͯ ﬁleA.c ͱ ﬁleA.h Λಉ͡Ϋϥελʹ·ͱΊຊ‫Ͱڀݚ‬͸ɼγεςϜͷιʔείʔυΛ༩͑Δͱɼಈ࡞ΔɼσόΠευϥΠόΛಉ͡Ϋϥελʹ·ͱΊΔɼ༷ʑͳ͕ྨࣅ͍ͯ͠Δؔ਺Λ 1 ͭͷΫϥελʹ·ͱΊΔΫϥελ

ؔ਺͔Β‫ͼݺ‬ग़͞ΕΔؔ਺Λಉ͡Ϋϥελʹ·ͱΊΔͳͲϦϯάख๏ΛఏҊ͢Δɽಈ࡞͕ྨࣅ͍ͯ͠Δͱ͸ɼؔ਺͕ͱ͍ͬͨΫϥελϦϯάͷํ਑Λࢦ͢ɽ͜ΕΒͷύλʔϯѻ͏σʔλͷ಺༰ʹΑΒͣɼσʔλͷ‫ࡧݕ‬ɼߋ৽ɼ࡟আͱ

Λର৅γεςϜͷಛ௃ʹ߹Θͤͯ։ൃऀʹఆٛͯ͠΋Β͏͍ͬͨॲཧͷ಺༰͕ྨࣅ͍ͯ͠Δ͜ͱΛ‫͏ݴ‬ɽຊख๏͸ɼ͜ͱͰɼ։ൃऀʹͱͬͯཧղ͠΍͍͢ΫϥελϦϯάΛߦιʔείʔυதͷࣝผࢠΛར༻͠ͳ͍ͨΊɼࣝผࢠʹҙຯ͏͜ͱΛ໨తͱ͍ͯ͠Δɽ

ͷͳ໊͍લ͕࢖ΘΕ͍ͯΔγεςϜʹରͯ͠ద༻͢Δ͜ͱ
͕Ͱ͖Δɽ·ͨɼຊ࿦จͰ͸ɼ࣮‫ݧ‬ର৅ͱͨ͠γεςϜͰ

2.2 ιʔείʔυͷྨࣅੑΛೝࣝ͢Δٕज़༻͍ΒΕ͍ͯΔ Java Λྫͱͯ͠ఏҊख๏ʹ͍ͭͯઆ໌͢

2.2.1 ίʔυΫϩʔϯ‫ݕ‬ग़Δ͕ɼ‫ۀ‬຿༻ͷϓϩάϥϛϯά‫͍༻͘޿ͯ͠ͱޠݴ‬ΒΕͯίʔυΫϩʔϯͱ͸ɼιʔείʔυதʹଘࡏ͢ΔಉҰ·

͍Δ COBOL ͳͲͷଞ‫΁ޠݴ‬ͷద༻΋ՄೳͱͳΔΑ͏ʹɼͨ͸ྨࣅͨ͠෦෼Λ࣋ͭίʔυยͷ͜ͱͰ͋Δɽ͜Ε·ͰҰൠతͳखଓ͖‫ʹޠݴܕ‬ଘࡏ͢Δ֓೦ͷΈΛ࢖༻ͨ͠ख๏

ͷ‫͍͓ͯʹڀݚ‬ɼίʔυΫϩʔϯΛ‫ݕ‬ग़͢Δ༷ʑͳख๏͕

ͱͳ͍ͬͯΔɽఏҊ͞Ε͓ͯΓɼࣝผࢠͷ৘ใΛར༻ͤͣʹɼେ‫ن‬໛γεຊख๏͸ɼγεςϜͷૢ࡞ը໘ʹର͢Δೖग़ྗॲཧͱ

ςϜʹ͓͚Δྨࣅͨ͠ίʔυย΍ؔ਺Λ‫ݕ‬ग़͢Δख๏΋ఏSQL จΛ࣮ߦ͢Δॲཧʢ͜ΕΒΛ·ͱΊͯ֎෦ΞΫηεͱҊ͞Ε͍ͯΔ [18]ɽ[18] Ͱ͸ɼιʔείʔυΛτʔΫϯͷ‫Ϳݺ‬ʣʹΑͬͯϝιουΛಛ௃͚ͮΔɽ֎෦ΞΫηε͸ɼྻʹม‫͠׵‬ɼ͋ΔҰఆҎ্ͷ௕͞ͰҰக͍ͯ͠ΔτʔΫϯγεςϜ͕༷ʑͳ‫ػ‬ೳΛఏ‫͢ڙ‬ΔͨΊͷ‫ج‬ຊతͳॲཧͰ͋

ྻΛίʔυΫϩʔϯͱͯ͠‫ݕ‬ग़͍ͯ͠Δɽ

ΔͨΊɼϝιουͷಈ࡞಺༰ΛΑ͘ද͍ͯ͠Δͱߟ͑ΒΕ͔͠͠ɼ͜ΕΒͷίʔυΫϩʔϯ‫ݕ‬ग़ख๏͸ɼຊ‫ڀݚ‬ͷΔɽ·ͨɼγεςϜͷ‫ػ‬ೳΛ࣮૷͢ΔͨΊʹ͸ɼ֎෦ΞΫ໨తʹରͯ͠͸ద੾Ͱ͸ͳ͍ɽίʔυΫϩʔϯ‫ݕ‬ग़Ͱ͸ɼηεͷ࣮ߦΛ৚݅෼‫ذ‬΍‫܁‬Γฦ͠ͳͲʹΑ੍ͬͯ‫͢ޚ‬Δඞ

αϒϧʔνϯͷ‫ͼݺ‬ग़͠Λߟྀͨ͠ྨࣅॲཧͷ‫ݕ‬ग़͸ߦΘཁ͕͋ΔͨΊɼ͜ΕΒͷ੍‫ޚ‬จ΋ϝιουͷಛ௃ͱͯ͠ந

Ε͍ͯͳ͍͕ɼຊ‫Ͱڀݚ‬͸ͦΕΛߟྀ͢Δඞཁ͕͋Δɽ·ग़͢Δɽ

c 2015 Information Processing Society of Japan⃝19

ソフトウェアエンジニアリングシンポジウム 2015
IPSJ/SIGSE Software Engineering Symposium (SES2015)

ର৅γεςϜதͷͲͷϝιου͕֎෦ΞΫηεʹରԠ͢ΧςΰϦΔ͔͸ɼ։ൃऀʹఆٛͯ͠΋Β͏ɽ֎෦ΞΫηεΛߦ͏ํ

SQL จͷ࣮ߦ๏͸‫ݶ‬ఆ͞Ε͍ͯΔͨΊɼରԠؔ܎Λఆٛͯ͠΋Β͏͜ͱ͸‫࣮ݱ‬తͰ͋Δͱߟ͑ΒΕΔɽͨͱ͑͹ɼJava Ͱ͸ JDBCͷ API Λ‫ͼݺ‬ग़͢͜ͱʹΑͬͯσʔλϕʔεΛૢ࡞͢Δ
ํ๏͕ҰൠతͰ͋ΓɼͦͷଞͷϥΠϒϥϦΛར༻͢Δ৔߹ը໘ͱͷೖग़ྗ

΋ɼσʔλϕʔεΛૢ࡞͢ΔͨΊʹ͸ܾΊΒΕͨ API Λ੍‫ޚ‬จ‫ͼݺ‬ग़͢ඞཁ͕͋Δɽຊख๏͸ɼҎԼͷ 3 ͭͷεςοϓ͔ΒͳΔɽ

Step 1ɽϓϩάϥϜͷม‫֤ ׵‬ϝιουΛɼ֎෦ΞΫηεͱ੍‫ޚ‬จͰߏ੒͞ΕΔϓϩάϥϜʹม‫͢׵‬Δɽ֎෦Ξ

ද 1 நग़͢ΔจͷҰཡจ‫߸ه‬

SELECT จΛ࣮ߦ͢Δ

SsɼSm

INSERT จΛ࣮ߦ͢Δ

IsɼIm

UPDATE จΛ࣮ߦ͢Δ

UsɼUm

DELETE จΛ࣮ߦ͢Δ

DsɼDm

ը໘͔Β஋ΛಡΈࠐΉ

RsɼRm

ը໘ʹ஋Λॻ͖ࠐΉWsɼWm

if จͷ։࢝

Ifif จͷऴྃ

If}

else અͷ։࢝E

for, while, do จͷ։࢝L

for, while, do จͷऴྃL}Ϋηεͱ੍‫ޚ‬จ͸ɼͦΕͧΕͷछྨʹରԠͨ͠‫Ͱ߸ه‬ද‫͞ݱ‬Εɼϝιου͸‫Ͱྻ߸ه‬ද‫͞ݱ‬ΕΔɽ

Step 2ɽྨࣅ౓ͷ‫ ࢉܭ‬ม‫ྻ߸ه֤ͨ͠׵‬Λ N-gram ʹද 2 ਤ 1 ͷίʔυʹର͢Δ֎෦ΞΫηεͷରԠ෇͚֎෦ΞΫηεରԠ͢Δϝιου

ΑΔू߹Ͱද͠ɼ͢΂ͯͷू߹ؒͷδϟοΧʔυ܎਺Λ‫͢ࢉܭ‬Δɽ͜ͷ஋Λϝιουؒͷྨࣅ౓ͱ͢Δɽ

SELECT จͷ࣮ߦ

OrderDao.selectStep 3ɽΫϥελϦϯάΞϧΰϦζϜͷద༻ ֤ ϝ ι ο

DELETE จͷ࣮ߦ

CustormerDao.deleteը໘͔Βͷೖྗ

Vo.getSelectedCustomersυΛද͢௖఺ͱɼStep 2 Ͱ‫౓ࣅྨͨ͠ࢉܭ‬ΛॏΈͱͨ͠ลΛ࣋ͭάϥϑΛ࡞੒͢Δɽ͜ͷάϥϑʹରͯ͠ΫϥελϦϯάΞϧΰϦζϜΛద༻͠ɼΫϥελϦ
ϯά݁ՌΛಘΔɽҎ߱Ͱ͸ɼ֤εςοϓͷৄࡉʹ͍ͭͯઆ໌͢Δɽ

৅ߏจ໦ͷਂ͞༏ઌ୳ࡧΛߦ͍ɼͦͷ๚໰ॱʹରԠ͢Δ‫ه‬߸Λฒ΂Δɽ֎෦ΞΫηεͱ੍‫ޚ‬จͷ։࢝͸ͦͷ௖఺ΛॳΊͯ๚໰ͨ͠ͱ͖ʹɼ੍‫ޚ‬จͷऴྃ͸ͦͷ௖఺ҎԼͷ୳ࡧ

3.1 Step 1ɽϓϩάϥϜͷม‫׵‬ΫϥελϦϯάର৅ͷ֤ϝιουΛɼ֎෦ΞΫηεͱ੍‫ޚ‬จͰߏ੒͞ΕΔϓϩάϥϜʹม‫͢׵‬Δɽ֎෦ΞΫηεͱ੍‫ޚ‬จ͸ɼͦΕͧΕͷछྨʹରԠͨ͠‫Ͱ߸ه‬ද‫͞ݱ‬Εɼϝιου͸‫Ͱྻ߸ه‬ද‫͞ݱ‬ΕΔɽຊख๏Ͱநग़͢Δจͱຊ࿦จʹ͓͚Δ‫߸ه‬ද‫ݱ‬Λද 1 ʹࣔ͢ɽͲͷϝιου‫ͼݺ‬ग़͕͠֎෦ΞΫηεʹରԠ͢Δ͔͸ɼ։ൃऀ͕ఆٛ͢Δɽ·ͨɼ֎෦ΞΫηεʹରԠ͢Δϝιου‫ͼݺ‬ग़͠จ͸ɼͦͷจ͕୯ҰͷϨίʔυΛѻ͏͔ɼෳ਺ͷϨίʔυΛѻ͏͔Λ۠ผ͢Δɽຊ࿦จͰ͸ͦΕͧΕͷ‫ʹ߸ه‬ɼ୯ҰϨίʔυͷ৔߹͸ s Λɼෳ਺Ϩίʔυͷ৔߹͸ m Λఴ͑Δ͜ͱʹΑ͕ͬऴྃͨ͠ͱ͖ʹɼରԠ͢Δ‫߸ه‬Λऔಘ͢Δɽ֎෦ΞΫηεҎ֎ͷϝιου‫ͼݺ‬ग़͠ʹରԠ͢Δ௖఺Λ๚໰ͨ͠৔߹
͸ɼͦͷ‫ͼݺ‬ग़͠ઌϝιουΛ࠶‫ؼ‬తʹ୳ࡧ͠ɼ‫ྻ߸ه‬Λ
औಘ͢Δɽந৅ߏจ໦ͷ୳ࡧ͕ऴྃͨ͠Βɼऔಘͨ͠‫߸ه‬ྻΛલ͔Βॱʹ૸ࠪ͠ɼ֎෦ΞΫηεΛؒʹ‫ؚ‬ΜͰ͍ͳ͍Α͏ͳ੍‫ޚ‬จͷ։࢝ͱऴྃͷ‫߸ه‬ͷ૊Λ‫͔ྻ߸ه‬Β࡟আ͢
Δɽຊख๏ͷ࣮૷͸ɼCesare Βͷख๏ [20] Λࢀߟʹ͓ͯ͠ΓɼJava development tools *1 ͷந৅ߏจ໦Λར༻͍ͯ͠
Δɽϝιου‫ͼݺ‬ग़͠͸ Class Hierarchy Analysis [21] ʹΑͬͯղܾ͕ͨ͠ɼຊ࿦จͷ࣮‫ݧ‬ର৅γεςϜͰ͸‫ͼݺ‬ग़͠ઌ͕ಈతʹ੾ΓସΘΔΑ͏ͳίʔυ͸ଘࡏ͠ͳ͔ͬͨɽ
ਤ 1 ͷίʔυΛ༻͍ͯม‫ྫ׵‬Λࣔ͢ɽਤ 1 ͷίʔυ͸ɼͯද‫͢ݱ‬Δɽ୯ҰϨίʔυͱෳ਺ϨίʔυͷͲͪΒΛѻ͏ϝιουͰ͋Δ͔͸ɼϝιουͷγάωνϟʹΑͬͯ൑அ
͢ΔɽSELECT จΛ࣮ߦ͢Δϝιουͱը໘͔Β஋ΛಡΈࠐΉϝιουͷ‫ͼݺ‬ग़͠ʹ͍ͭͯ͸ɼͦͷϝιουͷฦΓ஋͕഑ྻ͔Ϧετʢjava.util.ListʣͰ͋Δ৔߹͸ෳ਺Ϩίʔυͱ͠ɼͦ͏Ͱͳ͍৔߹͸୯ҰϨίʔυͱ͢Δɽ͜ΕΒҎ֎ͷϝιου‫ͼݺ‬ग़͠ʹ͍ͭͯ͸ɼͦͷϝιουͷҾ਺ʹ഑ྻ͔Ϧετ͕‫·ؚ‬ΕΔ৔߹͸ෳ਺Ϩίʔυͱ͠ɼͦ͏Ͱͳ͍৔߹͸୯ҰϨίʔυͱ͢Δɽ

͋ΔγεςϜͷ‫ސ‬٬৘ใ؅ཧը໘ʹ͓͍ͯɼϢʔβ͕બ୒ͨ͢͠΂ͯͷ‫ސ‬٬৘ใΛ‫ސ‬٬σʔλϕʔε͔ΒҰ‫࡟Ͱׅ‬
আ͢Δ‫ػ‬ೳΛ࣮૷͍ͯ͠ΔϝιουͰ͋Δɽ͜ͷϝιου
͸ɼબ୒͞Ε֤ͨ‫ސ‬٬৘ใʹରͯ͠ɼͦΕΛ࡟আͯ͠໰୊
ͳ͍͔֬ೝ͔ͯ͠Β࡟আΛߦ͏ɽ֬ೝॲཧ͸ 7ɼ8 ߦ໨Ͱɼ஫จςʔϒϧͷ‫ࡧݕ‬Λߦ͍ɼ࡟আ͠Α͏ͱ͍ͯ͠Δ‫ސ‬٬͕Կ΋஫จ͍ͯ͠ͳ͍͜ͱΛ֬ೝ͍ͯ͠Δɽ஫จ͕ͳ͚Ε͹ͦͷ‫ސ‬٬৘ใΛ࡟আ͠ɼͦ͏Ͱͳ͚Ε͹εΩοϓ͢Δɽ͜

֤ϝιου͸ɼந৅ߏจ໦ͷ୳ࡧʹΑͬͯɼιʔείʔͷϝιουʹରͯ͠ɼ֎෦ΞΫηεͷରԠ෇͚Λද 2 ͷΑυ্ͷॱ൪Ͱ‫ʹྻ߸ه‬ม‫͞׵‬ΕΔɽந৅ߏจ໦ͱ͸ɼϓϩ͏ʹఆٛͨ͠ͱ͢Δͱɼਤ 1 ͷϝιουͷ 4 ߦ໨͔Β 11άϥϜͷߏจղੳͷ݁ՌΛ໦ߏ଄Ͱද‫ͨ͠ݱ‬΋ͷͰ͋Δɽ
ந৅ߏจ໦ʹΑͬͯɼ৚݅෼‫ذ‬΍‫܁‬Γฦ͠ͳͲͷϓϩάϥ
Ϝͷ੩తͳߏ଄Λೝࣝ͢Δ͜ͱ͕Ͱ͖Δɽຊख๏Ͱ͸ɼநc 2015 Information Processing Society of Japan⃝ߦ໨·Ͱͷ಺༰͕ [Rm, L, Sm, If, Ds, If}, L}] ͱ͍͏‫߸ه‬ྻͰද‫͞ݱ‬ΕΔɽ
*1

http://eclipse.org/jdt/

20

ソフトウェアエンジニアリングシンポジウム 2015
IPSJ/SIGSE Software Engineering Symposium (SES2015)
1
2
3
4
5
6
7
8
9
10
11
12

void batchDeleteCustomer(CustomerDao cstDao,
OrderDao ordDao, Vo vo) {// 㑅ᢥ䛥䜜䛯㢳ᐈ䛾ID䜢ྲྀᚓ䛩䜛String[] idArray = vo.getSelectedCustomers();for (String id: idArray) {}ਤ 1ૉͷ਺Λ |V| ͱͨ͠ͱ͖ɼO(|V|log2 |V|) Ͱ͋Γ [24]ɼେ‫ن‬໛γεςϜͷΫϥελϦϯάʹద͍ͯ͠Δɽ

Newman ΒͷΞϧΰϦζϜ͸ɼΫϥελϦϯάͷର৅ͱ// ๐㝖ᑐ㇟䛾㢳ᐈ䛜ὀᩥ୰䛷䛺䛔䛛☜ㄆ䛩䜛}ΰϦζϜͷ‫ࢉܭ‬ෳࡶ౓͸ɼΫϥελϦϯάͷର৅ͱͳΔཁ

List<OrderDto> ordList = ordDao.select(id);if (ordList.isEmpty()) {cstDao.delete(id); // 㢳ᐈ᝟ሗ䜢䝔䞊䝤䝹䛛䜙๐㝖䛩䜛}

ͳΔཁૉΛάϥϑͷ௖఺Ͱද͠ɼཁૉؒͷؔ࿈ΛରԠ͢Δ
௖఺ؒͷลͰද͢ɽลʹ͸ɼؔ࿈ͷ‫͞ڧ‬Λද͢ॏΈΛ෇͚
Δ͜ͱ͕Ͱ͖Δɽ͜ͷάϥϑʹ͓͍ͯɼҎԼʹఆٛ͞ΕΔ

Q ஋͕࠷େͱͳΔΑ͏ͳΫϥελϦϯάΛ‫ٻ‬ΊΔɽબ୒͞Εͨ‫ސ‬٬ͷ৘ใΛҰ‫࡟Ͱׅ‬আ͢Δϝιου

Q=

3.2 Step 2ɽྨࣅ౓ͷ‫ࢉܭ‬



ki kj
1 
Aij −
δ(ci , cj )
W
W

(3)

i,j

Step 1 Ͱม‫ͯ΂ͨ͢͠׵‬ͷ‫ؒྻ߸ه‬ͷྨࣅ౓Λ‫͢ࢉܭ‬Δɽ‫ؒྻ߸ه‬ͷྨࣅ౓͸ɼ֤‫ྻ߸ه‬Λ N-gram ͔Βߏ੒͞

͜͜ͰɼAij ͸ɼ௖఺ i ͱ௖఺ j Λ઀ଓ͍ͯ͠ΔลͷॏΈΕΔू߹Ͱද‫͠ݱ‬ɼू߹ؒͷδϟοΧʔυ܎਺Λ‫͢ࢉܭ‬Δ

Λද͢ɽW ͸ɼ͢΂ͯͷ௖఺ؒͷลͷॏΈͷ࿨Ͱ͋Γɼ͜ͱͰ‫ٻ‬ΊΔɽN-gram ͱδϟοΧʔυ܎਺͸ɼจࣈྻؒW =ͷྨࣅ౓Λ‫͢ࢉܭ‬Δख๏ͱͯ͠޿͘࢖ΘΕ͓ͯΓɼಉ͘͡Δ͢΂ͯͷลͷॏΈͷ࿨Ͱ͋Γɼki =จࣈྻؒͷྨࣅ౓‫࢖ͯ͠ͱࢉܭ‬ΘΕ͍ͯΔ࠷௕‫ڞ‬௨෦෼cx ͸ɼ௖఺ x ͕ଐ͢ΔΫϥελͰ͋Γɼδ(ci , cj ) ͸ɼci = cjྻͱൺֱͯ͠‫ࢉܭ‬ίετ͕খ͍͞ɽͦͷͨΊɼN-gram ͱͷͱ͖ 1 ΛͱΓɼͦ͏Ͱͳ͍ͱ͖͸ 0 ΛͱΔؔ਺Ͱ͋Δɽ

δϟοΧʔυ܎਺ʹΑΔྨࣅ౓‫ࢉܭ‬͸ɼେ‫ن‬໛γεςϜͷ

Q ஋͸ɼΫϥελ಺ͷลͷॏΈͷ࿨͕େ͖͍ঢ়ଶͰ͋ΔͱղੳʹΑΓద͍ͯ͠Δͱ‫͑ݴ‬Δɽ

ߴ͘ͳΓɼΫϥελؒͷลͷॏΈͷ࿨͕େ͖͍ঢ়ଶͰ͋Δ

i,j Aij Ͱද͞ΕΔɽki ͸ɼ௖఺ i ʹ઀ଓ͞Ε͍ͯ

j Aij Ͱද͞ΕΔɽ

N-gram ͸ɼจࣈྻΛ௕͞ N ͷจࣈྻʹ෼ղͯ͠‫ه‬ड़ͱ௿͘ͳΔɽ͕ͨͬͯ͠ɼQ ஋͕࠷େͱͳΔΑ͏ͳΫϥε

͢Δख๏Ͱ͋ΔɽN ͸ύϥϝʔλͰ͋ΓɼN = 3 ͱ͢ΔλϦϯάΛ‫ٻ‬ΊΔ͜ͱͰɼΫϥελ಺ͷؔ࿈͕‫͍ڧ‬෼ྨΛ

tri-gram ͕Α͘༻͍ΒΕΔɽྫͱͯ͠ɼจࣈྻ “ABCDE”‫ٻ‬ΊΔ͜ͱ͕Ͱ͖Δɽ͔͠͠ɼQ ஋ͷ࠷େԽ͸ NP ࠔ೉ͰΛ tri-gram ʹΑΔू߹Ͱද‫͢ݱ‬ΔͱҎԼͷΑ͏ʹͳΔɽ

͋ΔͨΊ [25]ɼNewman ΒͷΞϧΰϦζϜͰ͸ҎԼͷΑ͏

{$$A, $AB, ABC, BCD, CDE, DE$, E$$}ͳᩦཉ๏Ͱ Q ஋࠷େԽͷۙࣅ‫ࢉܭ‬Λߦ͏ɽ(1)( 1 ) ͢΂ͯͷ௖఺͕ͦΕͧΕ 1 ͭͷΫϥελͰ͋Δͱ͢Δɽ’$’ ͸ɼจࣈྻͷઌ಄ͱ຤ඌΛද͢ಛघจࣈͰ͋Δɽ͜ͷΑ( 2 ) Q ஋͕࠷΋ߴ͘ͳΔΑ͏ʹ 2 ͭͷΫϥελΛซ߹͢Δɽ

͏ʹɼN-gram Λ༻͍Δ͜ͱͰจࣈྻͷॱংΛߟྀͭͭ͠ɼ

( 3 ) ͢΂ͯͷΫϥελ͕ 1 ͭʹซ߹͞ΕΔ·Ͱ 2 Λ‫܁‬Γฦ͢ɽͦΕΛू߹Ͱද‫͢ݱ‬Δ͜ͱ͕Ͱ͖Δɽू߹ؒͷྨࣅ౓͸ɼδϟοΧʔυ܎਺ʹΑΓ‫͢ࢉܭ‬Δɽ
δϟοΧʔυ܎਺͸ɼ2 ͭͷू߹ X, Y ʹ‫ڞ‬௨͢Δཁૉͷ|X ∩ Y||X ∪ Y|ΫϥελϦϯάͷ݁Ռͱ͢ΔɽఏҊख๏Ͱ͸ɼϓϩάϥϜͷ֤ϝιουΛάϥϑͷ௖఺ׂ߹Λද͢΋ͷͰ͋ΓɼҎԼͷΑ͏ʹఆٛ͞ΕΔɽ

Jaccard(X, Y) =( 4 ) ซ߹աఔͷத͔Β࠷΋ Q ஋͕ߴ͍ঢ়ଶΛબͼɼͦΕΛ

ͱ͠ɼStep 2 Ͱ‫౓ࣅྨͨ͠ࢉܭ‬Λ௖఺ؒͷลͷॏΈͱͯ͠(2)ఆٛΑΓɼX ͱ Y ͕ू߹ͱͯ͠౳͍͠৔߹ɼδϟοΧʔυ܎਺͸ 1 ͱͳΓɼX ͱ Y ʹ‫ڞ‬௨͢Δཁૉ͕ͳ͍৔߹͸ 0 ͱ
ͳΔɽ͜ͷఆٛʹ͕ͨͬͯ͠ɼ֤‫ྻ߸ه‬Λ N-gram Ͱදͨ͠ू߹ؒͷδϟοΧʔυ܎਺Λ‫͠ࢉܭ‬ɼͦͷ஋Λϝιου
ؒͷྨࣅ౓ͱ͢Δɽ

3.3 Step 3ɽΫϥελϦϯάΞϧΰϦζϜͷద༻
Step 2 Ͱ‫౓ࣅྨͨ͠ࢉܭ‬Λ༻͍ͯɼϝιουͷΫϥε
λϦϯάΛߦ͏ɽ͜Ε·Ͱʹ༷ʑͳΫϥελϦϯάΞϧΰ
ϦζϜ͕ఏҊ͞Ε͖͕ͯͨɼຊ‫Ͱڀݚ‬͸ Newman Β͕ఏNewman ΒͷΞϧΰϦζϜΛద༻͢Δɽͨͩ͠ɼ͢΂ͯͷ௖఺ؒʹล͕ଘࡏ͍ͯ͠ΔͱɼNewman ΒͷΞϧΰϦ
ζϜʹ͓͚Δซ߹͕ա৒ʹߦΘΕͯ͠·͍ɼྨࣅ౓ͷ௿͍ϝιου͕ಉ͡Ϋϥελʹ෼ྨ͞Εͯ͠·͏ͱߟ͑ΒΕΔ
ͨΊɼྨࣅ౓͕͋Δᮢ஋ະຬͰ͋Δϝιουʹ͍ͭͯ͸ɼͦΕΒͷؒͷลͷॏΈΛ 0 ͱ͢Δɽ͕ͨͬͯ͠ɼ2 ͭͷϝιου mi ɼmj ʹରԠ͢Δ௖఺ؒͷลͷॏΈ kij ͸ɼͦΕ
ͧΕͷ N-gram ʹΑΔू߹Λ Mi ɼMj ͱ͢ΔͱɼҎԼͷࣜͰද͞ΕΔɽ

kij =Jaccard(Mi , Mj )if (Jaccard(Mi , Mj ) ≥ th)0otherwiseҊͨ͠ΞϧΰϦζϜ [22] Λ༻͍Δɽ͜ͷΞϧΰϦζϜ͸ɼ(4)ιʔγϟϧωοτϫʔΫʹ͓͚ΔίϛϡχςΟΛ‫ݕ‬ग़͢Δ

ᮢ஋ th ͸ख๏ͷύϥϝʔλͱ͠ɼྨࣅ౓ͷ෼෍ʹΑͬͯ໨తͰఏҊ͞Ε͕ͨɼιϑτ΢ΣΞΫϥελϦϯάʹ͓͍มԽͤ͞Δ΋ͷͱ͢Δɽ

ͯ΋༗༻Ͱ͋Δ͜ͱ͕ࣔ͞Ε͍ͯΔ [12], [23]ɽ·ͨɼΞϧc 2015 Information Processing Society of Japan⃝21

ソフトウェアエンジニアリングシンポジウム 2015
IPSJ/SIGSE Software Engineering Symposium (SES2015)

ͱ͍ͬͨγεςϜͷಈ࡞ʹରԠ͍ͯ͠ΔɽΫϥελϦϯά

4. ධՁ࣮‫ݧ‬ఏҊख๏Λ࣮૷͠ɼ2 ͭͷ Java γεςϜʹରͯ͠ద༻͠
ͨɽຊ࣮‫Ͱݧ‬͸ɼΫϥελϦϯάͷྑ͞Λ‫ܭ‬ଌ͢Δ 3 ͭͷࢦඪʢ4.1 અͰड़΂ΔʣΛ‫ܭ‬ଌ͠ɼख๏ͷධՁΛߦ͏ɽ·ͨɼख๏ͷύϥϝʔλΛมԽͤͨ͞৔߹ʹɼΫϥελϦϯ
ά݁Ռ͕ͲͷΑ͏ʹมԽ͢Δ͔Λௐࠪ͢ΔͨΊʹɼख๏ͷ

Step 2 ʹ͓͚Δ N-gram ͷ N Λ 1ɼ3ɼ5 ͱมԽͤ͞ɼStep
3 ʹ͓͚Δྨࣅ౓ͷᮢ஋ th Λ 0.0 ͔Β 1.0 ·Ͱ 0.1 ࠁΈͰมԽ֤ͤͯ͞ࢦඪͷ‫ܭ‬ଌΛߦ͏ɽN=1 ͱ͢Δ͜ͱ͸ɼ‫߸ه‬ྻͷॱংΛߟྀͤͣʹ୯७ͳू߹ͱͯ͠ൺֱ͢Δ͜ͱΛҙຯ͢Δɽ·ͨɼth=1.0 ͱ͢Δ͜ͱ͸ɼN-gram ʹΑΔू߹͕‫׬‬શʹҰக͍ͯ͠ΔϝιουͷΈΛಉ͡Ϋϥελʹ·ͱΊΔ͜ͱΛҙຯ͢ΔɽҰൠʹɼN Λখ͘͢͞Δͱྨࣅ౓͸ߴ͘ͳΓ΍͘͢ɼN Λେ͖͘͢Δͱྨࣅ౓͸௿͘ͳΓ΍͍ͨ͢ΊɼN ͕খ͍͞৔߹͸ th Λߴ͘ઃఆ͠ɼN ͕େ͖͍৔߹͸ th Λ௿͘ઃఆ͢Δ΂͖Ͱ͋Δͱ༧૝͞ΕΔɽ࡞‫ۀ‬͸ɼओʹର৅γεςϜͷιʔείʔυΛಡղ͢Δ͜ͱʹΑͬͯߦ͍ɼγεςϜͷૢ࡞ϚχϡΞϧ΍ϝιου໊ͳͲ΋ࢀߟʹͨ͠ɽ

2 ͭͷΫϥελϦϯάؒͷ‫཭ڑ‬Λ‫ܭ‬ଌ͢Δࢦඪͱͯ͠ɼ
MoJoFM [27] Λ༻͍ͨɽMoJoFM ͸ɼ͋ΔΫϥελϦϯ
ά A ͔ΒผͷΫϥελϦϯά B ʹม‫͢׵‬Δͱ͖ʹɼҎԼ
ͷ 2 ͭͷૢ࡞͕ԿճඞཁͰ͋Δ͔Λ‫ܭ‬ଌ͢ΔࢦඪͰ͋Δɽ

Move ͋ΔΫϥελͷཁૉΛผͷΫϥελʹҠಈͤ͞Δɽ
Ҡಈͤ͞ΔཁૉΛ৽ͨʹ 1 ͭͷΫϥελͱ͢Δ͜ͱ΋‫ؚ‬Ήɽ

Join 2 ͭͷΫϥελΛซ߹͠ɼ1 ͭͷΫϥελʹ͢Δɽ
MoJoFM ͸ɼ্‫ه‬ͷૢ࡞ճ਺͕গͳ͍΄Ͳ A ͸ B ʹ͍ۙͱ͢ΔࢦඪͰ͋ΓɼҎԼͷΑ͏ʹఆٛ͞ΕΔɽ

MoJoFM(A, B) = (1−mno(A, B))×100% (5)max(mno(∀A, B))͜͜Ͱɼmno(A, B) ͸ɼA ͔Β B ʹม‫͢׵‬Δͷʹඞཁͳ࠷ఏҊख๏͕ɼ‫ʹ౓߹݁ͱ౓ूڽ‬ண໨ͨ͠ΫϥελϦϯά

খͷૢ࡞ճ਺Ͱ͋Δɽmax(mno(∀A, B)) ͸ɼB ʹม‫͢׵‬ख๏ͱ͸ҟͳΔΫϥελϦϯάΛߦ͏΋ͷͰ͋Δ͜ͱΛΔͷʹඞཁͳ࠷খͷૢ࡞ճ਺͕࠷େͰ͋ΔΑ͏ͳΫϥελ

֬ೝ͢ΔͨΊʹɼϝιουͷ‫ͼݺ‬ग़ؔ͠܎Λ༻͍ͨΫϥεϦϯάͷૢ࡞ճ਺Ͱ͋ΔɽMoJoFM ͷ஋͕ߴ͚Ε͹ߴ͍λϦϯάΛ࣮૷ͨ͠ɽ‫ͼݺ‬ग़ؔ͠܎Λ༻͍ͨΫϥελϦϯ΄ͲɼA ͸ B ʹ͍ۙ͜ͱΛҙຯ͠ɼMoJoFM ͕ 100% Ͱά͸ɼ֤ϝιουΛ௖఺ͱ͠ɼ‫ͼݺ‬ग़͞ΕΔՄೳੑͷ͋Δ

͋Ε͹ɼA ͸ B ʹ౳͍͜͠ͱΛҙຯ͢ΔɽMoJoFM ͸‫ڑ‬ϝιουؒΛลͰ઀ଓͨ͠άϥϑʹɼఏҊख๏ͱಉ༷ʹ཭Λ‫ܭ‬ଌ͢Δࢦඪͱͯ͠ఏҊ͞Ε͍ͯΔ͕ɼMoJoFM(A,Newman ΒͷΞϧΰϦζϜΛద༻͢Δ͜ͱʹΑͬͯߦͬB) ͱ MoJoFM(B, A) ͸Ұൠʹ౳͘͠ͳ͍ͨΊɼA Λख๏ͨɽ·ͨɼఏҊख๏ͷద੾ͳൺֱର৅ͱͳΔ‫ط‬ଘ‫͕ڀݚ‬ଘʹΑΔΫϥελϦϯάͱ͠ɼB Λਖ਼ղͷΫϥελϦϯάͱࡏ͠ͳ͍ͨΊɼϝιου໊͕ಉ͡Ͱ͋Δ΋ͷΛ 1 ͭͷΫϥͯ͠ධՁΛߦ͏ɽ

ελͱ͢ΔΫϥελϦϯάΛߦ͍ɼϝιου໊Λར༻͠ͳ

4.1.2 Ϋϥελͷ෼෍͍ຊख๏ΛධՁ͢ΔͨΊͷ໨҆ͱͨ͠ɽΫ ϥ ε λ ͷ େ ͖ ͞ ͕ ‫ ͋ Ͱ ୺ ۃ‬Δ ͔ Ͳ ͏ ͔ ͸ ɼNon-

Extremity of cluster DistributionʢNEDʣʹΑͬͯ‫ܭ‬ଌ
4.1 ධՁํ๏
ΫϥελϦϯάख๏ͷධՁ͸ɼҎԼͷ 3 ͭͷࢦඪΛ‫ܭ‬ଌ͢Δ͜ͱʹΑͬͯߦ͏ [26]ɽ
৴པੑ ख๏ʹΑΔΫϥελϦϯά͕ਖ਼͍͠ΫϥελϦϯ
άʹͲͷ͘Β͍͍͔ۙΫϥελͷ෼෍ Ϋϥελͷେ͖͕͞‫͔͍ͳͰ୺ۃ‬҆ఆੑ γεςϜͷιʔείʔυ͕গ͠มߋ͞Εͯ΋ɼΫϥελϦϯά݁Ռ͕େ͖͘มΘΒͳ͍͔

4.1.1 ৴པੑ৴པੑ͸ɼख๏ͷ໨తʹ߹ͬͨΫϥελϦϯάΛख࡞‫ۀ‬Ͱߦ͍ɼͦΕΛਖ਼ղͱΈͳͯ͠ख๏ʹΑΔΫϥελϦϯά
ͱͷ‫཭ڑ‬Λ‫ܭ‬ଌ͢Δ͜ͱʹΑͬͯධՁ͢Δɽຊ࣮‫Ͱݧ‬͸ɼ‫͚͓ʹۀا‬ΔϦΤϯδχΞϦϯάͷઐ໳ՈͰ͋Δୈࡾஶऀ͕ɼཧղʹ͓͍ͯ༗༻Ͱ͋Δͱߟ͑ΔΫϥελϦϯάΛख࡞‫ͨͬߦͰۀ‬ɽख࡞‫ۀ‬ͷΫϥελϦϯά͸ɼର৅γεςϜͷσʔλϕʔεʹରͯ͠ͲͷΑ͏ͳૢ࡞͕ߦΘΕΔ͔ͱ͍͏‫Ͱ఺؍‬෼ྨ͞Ε͍ͯΔɽ֤Ϋϥελ͸ 1 Ϩίʔυͷొ࿥ɼߋ৽ɼ‫ࡧݕ‬ɼ߲໨ৄࡉදࣔɼෳ਺ϨίʔυͷҰ‫৽ߋׅ‬c 2015 Information Processing Society of Japan⃝

͞ΕΔɽNED ͸ɼΫϥελͷཁૉ਺͕ܾΊΒΕͨൣғʹऩ·͍ͬͯΔ͔Λׂ߹Ͱද‫ͨ͠ݱ‬΋ͷͰ͋ΓɼҎԼͷΑ͏ʹఆٛ͞ΕΔɽNED(C) =

1
M



|c|

(6)

c∈C;5≤|c|≤max(20,M/5)

͜͜Ͱɼc ͸ΫϥελϦϯά C ʹ͓͚ΔΫϥελͰ͋Γɼ|c| ͸ c ͷཁૉ਺Ͱ͋Δɽ·ͨɼM ͸ΫϥελϦϯά C ʹ
͓͚Δ͢΂ͯͷཁૉ਺Ͱ͋ΔɽൣғͷԼ‫ݶ্ͱݶ‬͸ɼ͢΂ͯͷཁૉ਺ M Λߟྀͯ͠ద੾ͳ஋Λܾఆ͢Δඞཁ͕͋Δɽ͜͜Ͱ͸ɼຊ࣮‫ͱݧ‬ཁૉ਺͕͍ۙ‫ط‬ଘ‫ڀݚ‬ͷఆٛ [12] Λ༻͍ͨɽNED ͕ 1 ʹ͚ۙΕ͹ɼΫϥελͷେ͖͕͞‫Ͱ୺ۃ‬ͳ͍͜ͱΛҙຯ͢Δɽ

4.1.3 ҆ఆੑ҆ఆੑ͸ɼಉ͡γεςϜͷ࿈ଓͨ͠ 2 ͭͷόʔδϣϯʹରͯ͠ΫϥελϦϯάख๏Λద༻͠ɼಘΒΕͨ 2 ͭͷΫϥελϦϯάؒͷ‫཭ڑ‬Λ‫ܭ‬ଌ͢Δɽ҆ఆੑʹ͓͚Δ‫཭ڑ‬͸ɼΫϥεϦϯά A, B ؒͷ྆ํ޲ͷ‫͕཭ڑ‬౳͍͠ MoJoSim[28] Λ༻͍ΔɽMoJoSim ͸ MoJoFM ͱಉ༷ʹ Move ͱ22ソフトウェアエンジニアリングシンポジウム 2015
IPSJ/SIGSE Software Engineering Symposium (SES2015)ද 3 ର৅γεςϜର৅ϝιου਺
ςʔϒϧ਺

γεςϜ໊

MosP
ൢച؅ཧγεςϜ

Ϋϥελ਺

253-334

56-75

7

9

6

3

ද 4 MosP ʹ͓͚ΔϝιουͷରԠ෇͚֎෦ΞΫηεΫϥε໊ϝιου໊

SELECT จ
INSERT จ
UPDATE จ

Join ͷճ਺Λ਺͑Δ͕ɼҎԼͷఆٛͷΑ͏ʹ A ͔Β B ͱ

DELETE จ

B ͔Β A ͷ͏ͪɼૢ࡞ճ਺͕গͳ͍ํ޲Λ࠾༻͢Δɽ

ը໘͔Βͷೖྗ

OP) × 100%(7)N
OP = min(mno(A, B), mno(B, A)) (8)MoJoSim(A, B) = (1 −ը໘΁ͷग़ྗ

ﬁndFor Ͱ࢝·Δ
Dao ͰऴΘΔ

insertupdatedeleteɼlogicalDelete

Vo ͰऴΘΔget Ͱ࢝·Δ
set Ͱ࢝·Δͱ࢓༷ॻΛಡΈɼϝιουͷରԠ෇͚Λߦͬͨɽ࿈ଓͨ͠ 2 όʔδϣϯʹର͢Δ MoJoSim ͕ߴ͚Ε͹ɼͦͷΫϥελϦϯάख๏͸҆ఆੑ͕ߴ͍͜ͱΛҙຯ͢Δɽͨ

4.3 ݁Ռͱߟ࡯

ͩ͠ɼ2 όʔδϣϯؒͰΫϥελϦϯάͷཁૉ͕ҟͳΔ৔߹

4.3.1 MosP͸ɼ྆όʔδϣϯʹ‫ڞ‬௨͍ͯ͠Δཁૉʹରͯ͠ MoJoSim Λ

MosP ʹରͯ͠ख๏Λద༻ͨ݁͠ՌΛද 5 ʹࣔ͢ɽදʹ‫͢ࢉܭ‬Δɽෳ਺ͷ࿈ଓͨ͠όʔδϣϯؒʹରͯ͠ MoJoSim͓͚Δ MoJoFM ͷྻ͸ɼख๏ʹΑΔΫϥελϦϯά͕ਓΛ‫͠ࢉܭ‬ɼͦΕΒͷฏ‫ۉ‬஋Λ‫ٻ‬ΊΔ͜ͱͰ҆ఆੑͷධՁΛखʹΑΔΫϥελϦϯάʹͲͷ͘Β͍͍͔ۙΛ MoJoFMߦ͏ɽͰ‫ܭ‬ଌͨ͠஋Ͱ͋ΔɽNED ͸ɼΫϥελͷ෼෍͕‫Ͱ୺ۃ‬ͳ͍͔Λ‫ܭ‬ଌͨ͠஋Ͱ͋ΓɼMoJoSim ͸ɼ࿈ଓͨ͢͠΂

4.2 ࣮‫ݧ‬ର৅ͯͷόʔδϣϯʹର͢ΔΫϥελϦϯάؒͷ MoJoSim ͷຊ࣮‫Ͱݧ‬͸ɼ‫ۈ‬ଵ؅ཧγεςϜͰ͋Δ MosP ‫ۈ‬ଵ؅ཧฏ‫ۉ‬஋Ͱ͋Γɼख๏ͷ҆ఆੑΛද͍ͯ͠Δɽදͷ֤ྻʹ͓

V4 *2 ͱɼ͋Δ‫͚͓ʹۀا‬Δ։ൃ࿅श༻ͷൢച؅ཧγες͍ͯ࠷΋ߴ͍஋ΛଠࣈͰද‫͍ͯ͠ه‬Δɽ·ͨɼදͷ࠷ԼஈϜΛ༻͍ͯख๏ͷධՁΛߦ͏ɽͦΕͧΕͷγεςϜͷ‫ن‬໛ʹ͸ɼϝιουͷ‫ͼݺ‬ग़ؔ͠܎ʹΑΔΫϥελϦϯάͱϝΛද 3 ʹࣔ͢ɽද 3 ʹ͓͚Δର৅ϝιου਺ͱ͸ɼϢʔιου໊ʹΑΔΫϥελϦϯάʹ͓͚Δ MoJoFM ͷ஋Λβ͔ΒͷϘλϯૢ࡞ͳͲʹΑͬͯ‫ͼݺ‬ग़͞ΕΔϝιουͷ

ͦΕͧΕ͍ࣔͯ͠Δɽ͏ͪɼσʔλϕʔε΁ͷΞΫηεΛߦ͏΋ͷͷ਺Ͱ͋Γɼ

ද 5 ͔ΒɼMoJoSim ͸ύϥϝʔλʹΑΒͣߴ͍͜ͱ͕

͜ΕΒͷϝιουΛΫϥελϦϯάͷର৅ͱ͢ΔɽMosP

෼͔Δɽ͜Ε͸ɼ‫ػ‬ೳͷ࢓༷΍࣮૷͕มߋ͞Εͯ΋ɼ֎෦Ͱ͸ JDBCɼൢച؅ཧγεςϜͰ͸ iBATIS ΛͦΕͧΕΞΫηε͕େ͖͘มΘΔ͜ͱ͕গͳ͍ͨΊͰ͋Δͱߟ͑Βར༻ͯ͠σʔλϕʔε΁ͷΞΫηεΛߦ͏ɽςʔϒϧ਺ͱΕɼख๏ͷ҆ఆੑ͕ߴ͍͜ͱΛ͍ࣔͯ͠ΔɽNED ͸ N=5͸ɼର৅ϝιου͔ΒΞΫηε͞ΕΔςʔϒϧͷ਺Ͱ͋Δɽ

͔ͭ th=0.1 ͷ৔߹ʹ࠷΋ߴ͍஋ʢ0.94ʣͱͳ͓ͬͯΓɼ‫ۃ‬

MosP Ͱ͸ɼΫϥε໊͕ Action ͰऴΘΔΫϥεͷ action ϝ୺ͳେ͖͞ͷΫϥελ͕ඇৗʹগͳ͍͜ͱΛ͍ࣔͯ͠Δɽιου͔Β‫ͼݺ‬ग़͞ΕΔϝιουΛର৅ϝιουͱͨ͠ɽ

MoJoFM ͸ N ͷ஋ʹΑͬͯҟͳΔ͕ 45 ͔Β 55%Ͱ͋Γɼςʔϒϧ਺͸ɼsql ϑΝΠϧʹ͓͍ͯ “CREATE TABLE”

ϝιουͷ‫ͼݺ‬ग़ؔ͠܎ʹΑͬͯಘΒΕΔΫϥελϦϯά

ʹΑͬͯఆٛ͞Ε͍ͯΔςʔϒϧͷ໊લΛऔಘ͠ɼϑΟʔΑΓ΋ߴ͍஋͕ಘΒΕͨ͜ͱ͔Βɼಈ࡞͕ྨࣅͨ͠ϝιοϧυม਺ TABLE ʹͦΕΒͷ໊લ͕ఆٛ͞Ε͍ͯΔΫϥευʹ෼ྨ͢Δ໨తʹ͓͍ͯ͸ɼఏҊख๏ͷํ͕ਖ਼͍͠Ϋϥ਺ʹΑͬͯ‫ܭ‬ଌͨ͠ɽදதͷ “-” ͸ɼMosP ͷ 11 όʔδϣελϦϯάΛߦ͑Δͱ͍͑Δɽϯʢ4.0.0-4.4.2ʣʹ͓͚Δ࠷খ஋ͱ࠷େ஋Λ͓ࣔͯ͠Γɼ͜

MoJoFM ͱ NED ͷ஋͕όϥϯεΑ͘ߴ͍݁ՌΛ෼ੳΕΒͷόʔδϣϯΛ༻͍ͯ҆ఆੑͷධՁΛߦ͏ɽ৴པੑͱ

͢ΔͨΊʹɼMoJoFM ͱ NED ͷͦΕͧΕͷ஋ʹΑͬͯΫϥελͷ෼෍͸ɼ࠷΋ϝιου਺͕ଟ͍࠷৽όʔδϣϯύϥϝʔλͷॱҐ෇͚Λߦ͍ɼ2 ͭͷॱҐͷ࿨ͷ্Ґ 10 ݅Λ༻͍ͯͦΕͧΕධՁΛߦ͏ɽදͷΫϥελ਺͸ɼख࡞‫ۀ‬Λநग़ͨ͠ɽͦͷ݁ՌΛද 6 ʹࣔ͢ɽॱҐͷྻͷ‫಺ހׅ‬ͷͰ࡞੒ͨ͠Ϋϥελͷ਺Ͱ͋Δɽ਺ࣈ͸ɼͦΕͧΕͷࢦඪͷ஋Λද͢ɽද 6 ͔ΒɼN=1 ͔ఏҊख๏Λద༻͢Δʹ͸ɼ֎෦ΞΫηεʹରԠ͢Δϝͭ th=1.0 ͷ৔߹ MoJoFM ͸࠷΋ߴ͍͕ɼNED ͸ N=3ιουΛఆٛ͢Δඞཁ͕͋ΔͨΊɼୈҰஶऀ͕ιʔείʔ΍ N=5 ͷ৔߹ʹൺ΂ͯ௿͍஋ʹͳ͍ͬͯΔɽN=1 ͔ͭυͱίϝϯτΛಡΈɼද 4 ͷΑ͏ͳରԠ෇͚Λߦͬͨɽ

th=1.0 ͷ৔߹͸ɼநग़͞Εͨจͷछྨ͕ू߹ͱͯ͠౳͠

MosP Ͱ͸ɼΫϥε໊͕ “Dao” ͰऴΘΔΫϥε͕σʔλ͍ϝιουͷΈΛಉ͡ΫϥελʹूΊΔ͜ͱΛҙຯ͍ͯ͠ϕʔεΛૢ࡞͢Δ‫ػ‬ೳΛఏ‫͓ͯ͠ڙ‬ΓɼΫϥε໊͕ “Vo”

ΔɽͦͷͨΊɼख๏ͷ෼ྨ͕ඇৗʹࡉ͔͘ɼਓखʹΑΔΫͰऴΘΔΫϥε͕ૢ࡞ը໘ͱγεςϜͷؒͰ஋ͷड͚౉͠ϥελϦϯάͰҟͳΔΫϥελʹଐ͢Δϝιου͕ಉ͡ΫΛ͍ͯ͠Δɽൢച؅ཧγεςϜʹ͍ͭͯ΋ɼιʔείʔυϥελʹ‫·ؚ‬Εͯ͠·͏͜ͱ͸গͳ͍͕ɼཁૉ਺ 1 ͷΫϥ*2ελ͕਺ଟ͘‫ܗ‬੒͞Εͯ͠·͏ɽ࣮ࡍʹɼ88 ‫ݸ‬ͷΫϥε

http://sourceforge.jp/projects/mosp/releases/62164

c 2015 Information Processing Society of Japan⃝23

ソフトウェアエンジニアリングシンポジウム 2015
IPSJ/SIGSE Software Engineering Symposium (SES2015)
ද 5

N=1

MosP ʹର͢Δࢦඪ
N=3

N=5

th

MoJoFM

NED

MoJoSim

MoJoFM

NED

MoJoSim

MoJoFM

NED

MoJoSim
92.87

0.0

36.70

0.0

98.26

38.23

0.19

91.11

39.14

0.21

0.1

36.70

0.0

98.33

32.72

0.17

88.67

50.76

0.94

92.29

0.2

36.70

0.0

97.88

45.57

0.70

94.67

48.62

0.74

95.73

0.3

35.78

0.0

96.81

46.48

0.73

95.01

46.18

0.51

97.05

0.4

36.70

0.0

98.15

44.95

0.54

97.23

42.51

0.43

96.78

0.5

42.81

0.11

96.81

44.04

0.42

97.18

35.47

0.34

96.69

0.6

37.61

0.0

94.60

36.70

0.36

96.88

29.97

0.27

97.13

0.7

45.26

0.18

95.98

31.19

0.26

97.41

27.22

0.24

97.14

0.8

49.85

0.23

98.34

25.69

0.20

97.55

20.49

0.16

97.91

0.9

50.46

0.21

97.82

18.35

0.10

98.27

16.51

0.10

98.72

1.0

55.35

0.59

96.94

15.60

0.08

98.98

14.98

0.08

99.01

‫ͼݺ‬ग़ؔ͠܎ʹΑΔΫϥελϦϯάͷ MoJoFMɿ26.91
ϝιου໊ʹΑΔΫϥελϦϯάͷ MoJoFMɿ77.37

ύϥϝʔλͷॱҐ෇͚

MoJoFM ॱҐ

NED ॱҐ

ॱҐͷ࿨

Ϋϥελ਺

5, 0.12 (50.76)

1 (0.94)3

23

1, 1.01 (55.35)

5 (0.59)

6

88

5, 0.25 (48.62)

2 (0.74)779

3, 0.36 (46.48)

3 (0.73)984

3, 0.28 (45.57)

4 (0.70)1225

5, 0.37 (46.18)

7 (0.51)

14

135

3, 0.410 (44.95)

6 (0.54)16

126

1, 0.84 (49.85)

15 (0.23)

19

25

1, 0.93 (50.46)

16.5 (0.21)

19.5

57

3, 0.5

11 (44.04)

9 (0.42)20

152λͷ͏ͪɼ73 ‫ݸ‬ͷΫϥελ͕ཁૉ਺ 5 ‫ݸ‬ະຬͷඇৗʹখ͍͞ΫϥελͰ͋ͬͨɽҰํɼN=3 ͋Δ͍͸ N=5 ͷͱ͖

12
10Frequency

ද 6
N, th

8
6
4
2
0
0

ਤ 2

5

10

15

20

25

30

35

40

size of cluster

45

50

55

60

65

N=5ɼth=0.1 ͱͨ͠ΫϥελϦϯάͷཁૉ਺ͷ෼෍Λද͢ώετάϥϜʹ th Λ௿͘ઃఆ͢Δͱ N=1 ͷ৔߹ʹൺ΂ͯ NED ͸ߴ͍͕ɼMoJoFM ͷ஋͕௿͘ͳ͍ͬͯΔɽ͜Ε͸ɼख๏ͷΫʹ N Λ 3 ͋Δ͍͸ 5 ͱͨ͠৔߹͸ɼNED ΋ߴ͍஋ͱͳͬ

ϥελϦϯάʹ͓͍ͯɼਓखʹΑΔΫϥελϦϯάͰҟͳ͍ͯΔ͜ͱ͕෼͔Δɽϝιου໊ʹΑΔΫϥελϦϯάͷ

ΔΫϥελʹଐ͢Δϝιου͕ಉ͡Ϋϥελʹ‫·ؚ‬Εͯ͠

MoJoFM ͸ 77.37%Ͱ͋Γɼཁૉ਺ 300 ͷϥϯμϜͳΫϥ·ͬͨͨΊͰ͋Δɽ࣮ࡍʹɼN=5 ͔ͭ th=0.1 ͱͨ͠ΫϥελϦϯάͷ MoJoFM ͸ฏ‫ͯ͠ۉ‬໿ 15%Ͱ͋Δ [27] ͜ͱελϦϯάʹ͓͚Δ͋ΔΫϥελͰ͸ɼ27 ‫ݸ‬ͷ͢΂ͯཁ͔ΒɼఏҊख๏ͷ஋͸ϝιου໊Λར༻͠ͳ͍ख๏ͱͯ͠

ૉ͕ search ϝιουͰ͕͋ͬͨɼผͷΫϥελͰ͸ɼ13͸ߴ͍஋Ͱ͋Δͱߟ͑ΒΕΔɽ

‫ݸ‬ͷ batchUpdate ϝιουͱ 8 ‫ݸ‬ͷ delete ϝιου͕ࠞख๏Λ࣮ࡍͷγεςϜʹద༻͢Δ͜ͱΛߟ͑ΔͱɼN ͱࡏ͍ͯͨ͠ɽ͜ͷͱ͖ͷ֤Ϋϥελͷཁૉ਺͸ਤ 2 ͷΑ͏th ͷద੾ͳ஋Λ։ൃऀ͕൑அ͢Δඞཁ͕͋ΔɽMoJoFMͳ෼෍ͱͳͬͨɽখ͍͞Ϋϥελ͸·ͩଘࡏ͍ͯ͠Δ͕ɼͷ‫ܭ‬ଌʹ͸ਓखʹΑΔΫϥελϦϯά͕ඞཁͰ͋Δ͕ɼ

N=1 ͷ৔߹ʹൺ΂ͯେ͖ͳΫϥελ͕ಘΒΕ͍ͯΔ͜ͱ

NED ͷ‫ܭ‬ଌʹ͸ෆཁͰ͋ΔͨΊɼෳ਺௨ΓͷΫϥελϦϯ

͕෼͔Δɽ

άΛࢼߦ͢Δ͜ͱ͕Ͱ͖Δ৔߹͸ɼNED ͷ஋ʹΑͬͯ൑அΫϥελ਺͕ਤ 2 ͷΑ͏ʹൺֱతগͳ͍৔߹ɼఏҊख๏

͢Δ͜ͱ͕ߟ͑ΒΕΔɽද 5 ʹ͓͍ͯ MoJoFM ͱ NED

͸ɼਓखʹΑΔΫϥελϦϯάͰ͸ҟͳΔΫϥελʹ෼ྨͷ૬ؔ܎਺͸ 0.62 Ͱ͋Γɼਖ਼ͷ૬͕ؔ͋Δ͜ͱ͕֬ೝ͞

͞ΕΔΑ͏ͳϝιουΛɼ1 ͭͷΫϥελʹ‫ؚ‬Ίͯ͠·͏܏ΕͨͨΊɼNED ͷ஋͕ߴ͍ΫϥελϦϯάΛબ୒͢Ε͹ɼ޲͕͋ͬͨɽͦ͜Ͱɼද 6 ʹ͓͍ͯΫϥελ਺͕গͳ͍ 3ͦΕ͸৴པੑͷߴ͍ΫϥελϦϯάͰ͋ΔՄೳੑ͕͋Δɽ

ͭͷΫϥελϦϯάʹ͍ͭͯɼ֤Ϋϥελʹରͯ͠Ϋϥε

ͨͩ͠ɼNED ͸Ϋϥελͷ෼෍ͷ‫ۉ‬Ұ͞ΛଌΔࢦඪͱ͠λϦϯάΛద༻͠ɼαϒΫϥελ΁ͷ෼ྨΛߦ͏ͱ͍͏௥

ͯ༻͍ΒΕ͍ͯΔ͕ɼ෼෍͕‫ۉ‬ҰͰ͋Δ͜ͱ͕γεςϜཧՃௐࠪΛߦͬͨɽͦͷ݁ՌΛද 7 ʹࣔ͢ɽද 7 ͔Βɼαϒղʹ͓͍ͯৗʹ༗རͰ͋Δͱ͸‫ݶ‬Βͳ͍ɽͦͷͨΊɼෳ਺Ϋϥελ΁ͷ෼ྨʹΑͬͯ MoJoFM ͕޲্͓ͯ͠Γɼಛͷ։ൃऀͰ࡞‫ۀ‬Λ෼୲͢Δ͜ͱΛߟྀ͠ɼΫϥελ਺ʹΑc 2015 Information Processing Society of Japan⃝24

ソフトウェアエンジニアリングシンポジウム 2015
IPSJ/SIGSE Software Engineering Symposium (SES2015)

N, thද 7 αϒΫϥελ΁ͷ෼ྨ
MoJoFM NED Ϋϥελ਺5, 0.1

59.94

0.88

48

3, 0.2

59.63

0.83

50

1, 0.8

56.27

0.66

32

8

6

4

Δ൑அΛߦ͏͜ͱ΋ߟ͑ΒΕΔɽେ‫ن‬໛γεςϜͰ͸ෳ਺

2ʹઃఆ͠ɼஈ֊తʹΫϥελϦϯάΛద༻͢Δ͜ͱͰ৴པ
ੑ͕ߴ͘ɼΫϥελͷେ͖͕͞ద੾ͳΫϥελϦϯά͕ಘsearch3

search2

search1

update1batch2

update2

regist1

͋Δ͍͸ N=5 ͱ͠ɼth Λ 0.1 ͋Δ͍͸ 0.2 ͳͲͷ௿͍஋

0batch1ߟ͑ΒΕΔ͕ɼͦͷΑ͏ͳ৔߹͸ɼද 7 ͷ݁Ռ͔ΒɼN=3

update3௨ΓͷΫϥελϦϯάΛࢼߦ͢Δ͜ͱ͕ࠔ೉Ͱ͋Δ͜ͱ΋

ਤ 3 ൢച؅ཧγεςϜͷΫϥελϦϯά

ΒΕΔ͜ͱ͕‫ظ‬଴Ͱ͖Δɽ

4.3.2 ൢച؅ཧγεςϜ

4.4 ଥ౰ੑ΁ͷ‫ڴ‬Җൢച؅ཧγεςϜ͸‫ن‬໛͕খ͘͞ɼύϥϝʔλʹΑΔࠩຊ࣮‫Ͱݧ‬͸ɼ‫ۀا‬ͷઐ໳Ո͕࡞੒ͨ͠ΫϥελϦϯάΛ

ҟ͕খ͍ͨ͞ΊɼN=3ɼth=0.0 ͱͨ͠৔߹ͷΫϥελϦ

༻͍ͯख๏ͷධՁΛߦͬͨɽઐ໳Ո͸ɼର৅γεςϜͷ

ϯά݁ՌͷΈΛࣔ͢ɽਤ 3 ͸ɼΫϥελϦϯάͷ݁ՌΛιʔείʔυΛ‫ͯݟ‬෼ྨΛߦ͕ͬͨɼιʔείʔυதͷϝथ‫ܗ‬ਤͰࣔͨ͠΋ͷͰ͋Δɽ੺৭ͷਫฏઢ͸ख๏ʹΑΔΫιου໊Λࢀߟʹͨͨ͠Ίɼ໋໊͕ෆద੾ͳ΋ͷ͕͋ͬͨϥελϦϯά݁ՌΛද͓ͯ͠ΓɼͦͷઢͰथ‫ܗ‬ਤΛ੾அ͢৔߹͸ɼ໨తͱҟͳΔ෼ྨΛߦ͍ͬͯΔՄೳੑ͕͋Δɽ·Δͱɼ֤πϦʔ͕ 1 ͭͷΫϥελʹରԠ͢Δ͜ͱΛҙຯͨɼҟͳΔ։ൃऀ͕࡞੒ͨ͠ΫϥελϦϯάΛ༻͍ͨ৔߹

͍ͯ͠Δɽupdate1ɼsearch1 ͳͲͷཁૉ໊͸ɼਓखʹΑΔ

͸ɼຊ࣮‫݁ͱݧ‬Ռ͕ҟͳΔՄೳੑ͕͋Δɽ

ΫϥελϦϯά݁ՌΛද͓ͯ͠Γɼ਺ࣈΛআ͍ͯಉ໊͡લ

ख๏Λର৅γεςϜʹରͯ͠ద༻͢ΔͨΊʹɼୈҰஶऀͷ΋ͷ͕ಉ͡Ϋϥελʹ෼ྨ͞Εͨ͜ͱΛҙຯ͢Δɽਤ 3

͕֎෦ΞΫηεͱϝιουͷରԠ෇͚ΛߦͬͨɽୈҰஶऀ͔Βɼ‫ࡧݕ‬Λߦ͏ϝιουʹ͍ͭͯ͸ख๏ͱਓखʹΑΔ෼͸ɼγεςϜͷιʔείʔυΛಡղ্ͨ͠Ͱɼද 4 ͷΑ͏ྨ͕Ұக͍ͯ͠Δ͕ɼͦͷଞͷϝιου͸྆ऀͷ෼ྨ͕ҟͳΫϥε໊ͱϝιου໊ʹΑΔϧʔϧͰ֎෦ΞΫηεͱϝͳ͍ͬͯΔɽ͜Ε͸ɼൃߦ͢Δ SQL จ͕ҟͳΔϝιου

ιουͷରԠ෇͚Λߦ͕ͬͨɼ͢΂ͯͷιʔείʔυΛ໨Ͱ΋ɼྨࣅͨ͠ಈ࡞Λ࣮‫͍ͯ͠ݱ‬Δ͜ͱ͕͋ΔͨΊͩͱߟࢹͰ֬ೝ͢Δ͜ͱ͸ߦ͍ͬͯͳ͍ɽͦͷͨΊɼ࣮ࡍʹ͸֎͑ΒΕΔɽͨͱ͑͹ɼbatch1 ͱ batch2 ͸Ϛελςʔϒϧ෦ΞΫηεͱͯ͠૬Ԡ͘͠ͳ͍ϝιουΛରԠ෇͚͍ͯͨ

ͷ৘ใΛҰ‫͢৽ߋͰׅ‬ΔॲཧͰ͋Δ͕ɼbatch1 ͸ςʔϒϧΓɼରԠ෇͚Δ΂͖ϝιουΛ‫ݟ‬ಀ͍ͯ͠ΔՄೳੑ͕͋ΔɽͷϨίʔυΛશ݅࡟আͨ͠‫ޙ‬ɼ৽ͨͳϨίʔυΛ INSERT͜ΕΒͷରԠ෇͚ͷํ๏ʹΑͬͯɼ࣮‫݁ݧ‬Ռ͕ҟͳΔՄೳจʹΑͬͯొ࿥͢Δ͜ͱͰߋ৽ॲཧΛߦ͓ͬͯΓɼbatch2

ੑ͕͋Δɽ

͸ UPDATE จʹΑͬͯ‫ط‬ଘͷϨίʔυͷ৘ใΛॻ͖‫͑׵‬ఏҊख๏͸ɼࣝผࢠʹҙຯͷ͋Δ໊લ͕༩͑ΒΕ͍ͯͳͯߋ৽ॲཧΛߦ͍ͬͯΔɽఏҊख๏Ͱ͸ɼ͜ΕΒͷϝιο

͍γεςϜʹ޲͚ͯઃ‫͞ܭ‬Ε͍ͯΔ͕ɼຊ࣮‫Ͱݧ‬͸ɼJavaυ͕ൃߦ͢Δ SQL จ͕ҟͳΔͨΊɼϝιουؒͷྨࣅ౓͸Ͱॻ͔Εͨ‫ۀ‬຿γεςϜΛର৅ʹख๏ͷධՁΛߦͬͨɽධখ͘͞ͳΔ͕ɼਓखʹΑΔΫϥελϦϯάͰ͸ɼ྆ϝιοՁ࣮‫͍༻ʹݧ‬Δ͜ͱ͕Ͱ͖ΔγεςϜ͕‫ݶ‬ΒΕ͍ͯΔ͜ͱυͱ΋ෳ਺ͷϨίʔυΛҰ‫͢৽ߋͰׅ‬ΔॲཧͰ͋Δ͜ͱ͔

ͱɼΫϥελϦϯάͷ৴པੑΛ‫ܭ‬ଌ͢ΔͨΊʹਓखʹΑΔ

Βࣅ͍ͯΔϝιουͰ͋Δͱ൑அ͞Εͨɽ͜ͷΑ͏ʹɼਓίʔυಡղͱΫϥελϦϯά࡞‫͕ۀ‬ඞཁͰ͋Δ͜ͱ͔ΒɼखʹΑΔΫϥελϦϯάͰ͸ɼൃߦ͢Δ SQL จ͕ҟͳͬͯ

ද 3 ͷ Java γεςϜΛର৅ʹ͍ͯ͠ΔɽଞͷγεςϜ΍

͍ͯ΋ɼͦΕΒͷจ͕࣮‫͍ͯ͠ݱ‬Δॲཧͷ಺༰Λߟྀ͢Δ

ଞ‫͔ॻͰޠݴ‬ΕͨγεςϜʹରͯ͠͸ɼຊ࣮‫ͱݧ‬ಉ͡Α͏ͨΊɼఏҊख๏ʹΑΔΫϥελϦϯάͱҟͳΔ݁Ռʹͳͬͳ༗༻ੑ͕ಘΒΕͳ͍Մೳੑ͕͋Δɽ

ͨͱߟ͑ΒΕΔɽ·ͨɼൢച؅ཧγεςϜͰ͸ɼόονॲཧͱΦϯϥΠϯॲཧΛ۠ผ͢Δ͜ͱ͕ࠔ೉Ͱ͋ͬͨɽΦϯ

5. ख๏ͷ࣮༻Խʹ޲͚ͨٞ࿦

ϥΠϯॲཧʹ͓͍ͯ΋ INSERT จΛ‫܁‬Γฦ͢ॲཧ͕ߦΘఏҊख๏͸ɼࣝผࢠ͕༗༻Ͱͳ͍γεςϜʹରͯ͠ద༻

Ε͓ͯΓɼ྆ऀͷ੍‫ߏޚ‬଄͕ྨࣅ͢Δ͜ͱ͕͋ͬͨɽ͜Ε

͢Δ͜ͱΛ૝ఆ͍ͯ͠ΔɽͦͷͨΊɼ࣮ࡍͷγεςϜͰ֎ΒΛ۠ผ͢ΔͨΊʹ͸ɼ֎෦ΞΫηεͷछྨ͚ͩͰͳ͘ɼ

෦ΞΫηεͱؔ਺ͷରԠ෇͚Λߦ͏͜ͱ͸ɼຊ࣮‫͍ͨ༻ݧ‬σʔλͷೖྗ‫͕ݩ‬ը໘Ͱ͋Δ͔ϑΝΠϧͰ͋Δ͔ͱ͍͏৘

Α͏ͳ Java γεςϜʹ͓͚Δ࡞‫Ͳ΄ۀ‬༰қͰ͸ͳ͍ɽ͠ใΛऔಘ͢Δඞཁ͕͋Δͱߟ͑ΒΕΔɽ

͔͠ɼҰൠతʹɼ֎෦ΞΫηεΛߦ͏ͨΊʹ͸ܾΊΒΕͨc 2015 Information Processing Society of Japan⃝25

ソフトウェアエンジニアリングシンポジウム 2015
IPSJ/SIGSE Software Engineering Symposium (SES2015)

API ΍ READ/WRITE ͳͲͷγεςϜίʔϧΛ‫ͼݺ‬ग़͢Ձ͢Δ͜ͱ͕ࠓ‫ޙ‬ͷ՝୊Ͱ͋Δɽ͞Βʹɼ‫͔͘ݹͰۀا‬Βඞཁ͕͋ΔͨΊɼ֎෦ΞΫηεʹରԠ͢ΔՄೳੑͷ͋Δؔ

։ൃ͕ଓ͍͍ͯΔେ‫ن‬໛ͳγεςϜʹରͯ͠ख๏Λద༻਺΍໋ྩ͸‫ݶ‬ఆ͞ΕΔɽ·ͨɼର৅γεςϜͷอकΛߦͬ

͢Δ͜ͱ΋ඞཁͰ͋Δɽେ‫ن‬໛γεςϜͰͷద༻݁Ռͷ෼

͍ͯΔ։ൃऀͰ͋Ε͹ɼ෦෼తͳཧղ͔͠Ͱ͖͍ͯͳ͍৔

ੳ΍ɼ։ൃऀ͔ΒͷϑΟʔυόοΫΛಘΔ͜ͱͳͲʹΑͬ߹Ͱ΋ɼͲͷؔ਺ʹΑͬͯ֎෦ΞΫηε͕ߦΘΕ͍ͯΔ͔

ͯɼख๏ͷվળΛߦ͏͜ͱ͕ߟ͑ΒΕΔɽಛʹɼඇৗʹ‫ݹ‬Λ൑அͰ͖Δͱߟ͑ΒΕΔɽอक։ൃऀ͕൑அΛߦ͏࡞‫ۀ‬͍γεςϜͰ͸ɼϦϨʔγϣφϧσʔλϕʔε͕࢖ΘΕͯ͸ඞཁͰ͋Δ͕ɼͦͷ݁ՌΛ༻͍ͯఏҊख๏ʹΑΔΫϥε

͍ͳ͍͜ͱ΋͋ΔͨΊɼϑΝΠϧͷಡΈॻ͖Λߦ͏໋ྩΛλϦϯάΛߦ͏͜ͱͰɼଞͷ։ൃऀͱͷ஌ࣝͷ‫ڞ‬༗͕Մೳ֎෦ΞΫηεʹରԠ෇͚ͯΫϥελϦϯάΛߦ͏͜ͱͳͲ

ʹͳΓɼอक։ൃऀ΁ͷώΞϦϯά͕ूத͢Δ͜ͱΛආ͚΋ൃలతͳ՝୊ͱͯ͠‫͛ڍ‬ΒΕΔɽ·ͨɼఏҊख๏͸ɼ֎

Δ͜ͱ͕Ͱ͖Δɽ·ͨɼ1 ͭͷΫϥελʹଐ͢Δؔ਺Λྨ෦ΞΫηεʹରԠ͢ΔϝιουΛ։ൃऀ͕ఆٛ͢Δඞཁ͕

ࣅॲཧͱͯ͠·ͱΊͯཧղ͢Δ͜ͱͰɼγεςϜશମͷཧ͋Γɼର৅γεςϜʹؔ͢Δ஌͕ࣝ͋Δఔ౓ཁ‫͞ٻ‬ΕΔͨ

ղ͕ޮ཰Խ͞ΕΔͱߟ͑ΒΕΔɽ

ΊɼରԠ෇͚Λ༰қʹ͢Δ͜ͱ͕֦ுతͳ՝୊ͱͯ͠‫͛ڍ‬ຊख๏͸ɼϑΝΠϧ਺͕ 10 ສΛ௒͑ΔΑ͏ͳେ‫ن‬໛γΒΕΔɽ۩ମతʹ͸ɼϝιουͷ‫ͼݺ‬ग़ؔ͠܎Λநग़͠ɼεςϜʹରͯ͠ద༻͢Δ͜ͱΛ໨ࢦ͍ͯ͠ΔͨΊɼ‫ࢉܭ‬༷ʑͳϝιου͔Βͷ‫ͼݺ‬ग़͕͠ूத͍ͯ͠ΔϝιουΛ

ίετͷখ͍͞ΞϧΰϦζϜ͕ཁ‫͞ٻ‬ΕΔɽຊख๏Ͱ͸ɼ֎෦ΞΫηεͷީิͱͯ͠ఏࣔ͢Δ͜ͱ͕ߟ͑ΒΕΔɽ

Step 1 ʹ͓͚ΔߏจղੳɼStep 2 ʹ͓͚Δ N-gram ʹΑΔδϟοΧʔυ܎਺ͷ‫ࢉܭ‬ɼStep 3 ʹ͓͚Δ Newman Βँࣙ ຊ‫ڀݚ‬͸Պ‫ݚ‬අ No.25220003, 26280021 ͷॿ੒Λಘͨ΋ͷͰ͋Δɽ

ͷΫϥελϦϯάΞϧΰϦζϜ͕ओͳॲཧͱͳΔɽߏจղੳ͸ɼϓϩάϥϛϯά‫ʹޠݴ‬ΑͬͯҟͳΔ͕ɼҰൠʹߴࢀߟจ‫ݙ‬

଎ʹߦ͏͜ͱ͕Ͱ͖ΔΑ͏ʹઃ‫͞ܭ‬Ε͍ͯΔ͜ͱ͕ଟ͍ɽ

[1]

N-gram ʹΑΔδϟοΧʔυ܎਺ͷ‫Ͱࢉܭ‬͸ɼ͢΂ͯͷू߹ؒͰྨࣅ౓Λ‫͢ࢉܭ‬Δඞཁ͕͋Δ͕ɼฒྻ‫ʹࢉܭ‬ΑΔߴ

[2]଎Խ͕ՄೳͰ͋ΔɽNewman ΒͷΫϥελϦϯάΞϧΰϦ
ζϜ͸ɼ௖఺਺͕ 40 ສΛ௒͑Δάϥϑʹରͯ͠΋ద༻͞Ε͍ͯΔ [24]ɽҎ্ͷ͜ͱ͔Βɼຊख๏͸‫ࢉܭ‬ίετͷ‫؍‬[3]఺ʹ͓͍ͯɼେ‫ن‬໛γεςϜ΁ͷద༻Մೳੑ͕ߴ͍ͱߟ͑
ΒΕΔɽ

[4]

6. ·ͱΊͱࠓ‫ޙ‬ͷ՝୊

[5]ຊ‫Ͱڀݚ‬͸ɼιʔείʔυதͷ֤ؔ਺͔ΒγεςϜͷૢ[6]࡞ը໘΍σʔλϕʔε΁ͷΞΫηεΛߦ͏໋ྩΛநग़͠ɼಈ࡞͕ྨࣅ͍ͯ͠Δؔ਺ͷू߹ʹ෼ྨ͢ΔΫϥελϦϯά
ख๏ΛఏҊͨ͠ɽධՁ࣮‫Ͱݧ‬͸ɼ2 ͭͷ Java γεςϜʹ

[7]ରͯ͠ख๏Λద༻͠ɼΫϥελϦϯά݁ՌΛධՁ͢ΔࢦඪΛ‫ܭ‬ଌͨ͠ɽΫϥελͷ෼෍ͷࢦඪ NED Λ༻͍ͯద੾ͳ
ΫϥελϦϯά݁ՌΛબఆͰ͖ΔՄೳੑ͕͋Γɼ·ͨɼେ͖ͳΫϥελʹରͯ͠͸͞ΒʹΫϥελϦϯάΛߦ͏͜ͱ[8]ʹΑͬͯஈ֊తʹ෼ׂ͢Δ͜ͱͰɼਓखʹΑΔΫϥελϦ
ϯάʹۙͮ͘͜ͱ͕෼͔ͬͨɽMoJoFM Ͱ‫ܭ‬ଌͨ͠ਓख
ʹΑΔΫϥελϦϯάͱͷ‫཭ڑ‬͸ɼఏҊख๏͕໿ 60%ɼϝ[9]ιου໊ʹΑΔ෼ྨ͕໿ 77%Ͱ͋Γɼࣝผࢠʹҙຯͷ͋Δ໊લ͕༩͑ΒΕ͍ͯͳ͍ঢ়‫گ‬ԼͰ΋ಈ࡞͕ྨࣅͨ͠ϝιουΛ‫ݕ‬ग़Ͱ͖Δ͜ͱΛࣔͨ͠ɽຊ࣮‫Ͱݧ‬͸ɼઐ໳Ո͕γεςϜཧղʹ͓͍ͯ༗༻Ͱ͋Δ

[10]
[11]

ͱ൑அͨ͠ΫϥελϦϯάͱख๏ʹΑΔΫϥελϦϯάͷ
‫཭ڑ‬ΛఆྔతʹධՁͨ͠ɽ͜ΕΒͷΫϥελϦϯά͸ཧղʹ͓͍ͯ༗༻Ͱ͋Δͱߟ͍͑ͯΔ͕ɼཧղ࡞‫ۀ‬ͷίετ΁
ͷӨ‫ڹ‬͸ධՁͰ͖͍ͯͳ͍ͨΊɼ࡞‫ۀ‬ίετΛఆྔతʹධc 2015 Information Processing Society of Japan⃝[12]

Ұൠࣾஂ๏ਓ೔ຊ৘ใγεςϜɾϢʔβʔ‫ڠ‬ձʢJUASʣɿιϑτ΢ΣΞϝτϦοΫεௐࠪ 2012 (2012).
Ducasse, S. and Pollet, D.: Software Architecture Reconstruction: A Process-Oriented Taxonomy, IEEE Transactions on Software Engineering, Vol. 35, No. 4, pp.
573–591 (2009).
Sneed, H. M.: Object-oriented COBOL recycling, Proceedings of the 3rd Working Conference on Reverse Engineering, pp. 169–178 (1996).
McConnel, S.: Code Complete, Second Edition, Microsoft Press (2004).
Koschke, R. and Simon, D.: Hierarchical Reﬂexion Models, Proceedings of the 10th Working Conference on Reverse Engineering, pp. 36–45 (2003).
Maqbool, O. and Babri, H.: Hierarchical Clustering
for Software Architecture Recovery, IEEE Transactions
on Software Engineering, Vol. 33, No. 11, pp. 759–780(2007).
Kobayashi, K., Kamimura, M., Yano, K., Kato, K. andMatsuo, A.: SArF map: Visualizing software architecture from feature and layer viewpoints, Proceedings ofthe 21st International Conference on Program Comprehension, pp. 43–52 (2013).
Mitchell, B. S. and Mancoridis, S.: On the automatic
modularization of software systems using the bunch tool,
IEEE Transactions on Software Engineering, Vol. 32,
No. 3, pp. 193–208 (2006).
Mancoridis, S. and Mitchell, B.: Bunch: A clustering
tool for the recovery and maintenance of software system
structures, Proceedings of the 7th International Conference on Software Maintenance, pp. 50–59 (1999).
ѳඒ‫ل‬णɿϓϩάϥϜղੳٕज़Λ༻͍ͨιʔείʔυ࠶ར༻ࢧԉʹؔ͢Δ‫ڀݚ‬ɼത࢜࿦จɼ໊‫ݹ‬԰େֶ (2007).
Müller, H. A., Orgun, M. A., Tilley, S. R. and Uhl, J. S.:
A Reverse Engineering Approach To Subsystem Structure Identiﬁcation, Journal of Software Maintenance:
Research and Practice, Vol. 5, No. 4, pp. 181–204 (1993).
Kobayashi, K., Kamimura, M., Kato, K., Yano, K. andMatsuo, A.: Feature-gathering dependency-based soft-

26

ソフトウェアエンジニアリングシンポジウム 2015
IPSJ/SIGSE Software Engineering Symposium (SES2015)

[13]

[14]

[15]

[16]

[17]

[18]

[19]

[20]

[21]

[22]

[23]

[24]

[25]

[26]

[27]

[28]

ware clustering using Dedication and Modularity, Proceedings of the 28th International Conference on Software Maintenance, pp. 462–471 (2012).
Anquetil, N. and Lethbridge, T.: Comparative Study ofClustering Algorithms and Abstract Representations for
Software Remodularization, IEE Proceedings-Software,Vol. 150, No. 3, pp. 185–201 (2003).
Andritsos, P. and Tzerpos, V.: Information-theoretic
software clustering, IEEE Transactions on Software Engineering, Vol. 31, No. 2, pp. 150–165 (2005).
Anquetil, N. and Lethbridge, T.: Recovering software architecture from the names of source ﬁles, Journal of Software Maintenance, Vol. 11, No. 3, pp. 201–221 (1999).
Scanniello, G., D’Amico, A., D’Amico, C. and D’Amico,
T.: Using the Kleinberg Algorithm and Vector Space
Model for Software System Clustering, Proceedings ofthe 18th International Conference on Program Comprehension, pp. 180–189 (2010).
Tzerpos, V. and Holt, R.: ACDC: An algorithm forcomprehension-driven clustering, Proceedings of the 7th
Working Conference on Reverse Engineering, pp. 258–
267 (2000).
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).
McMillan, C., Grechanik, M. and Poshyvanyk, D.: Detecting similar software applications, Proceedings of the34th International Conference on Software Engineering, pp. 364–374 (2012).
Cesare, S. and Xiang, Y.: Malware Variant Detection Using Similarity Search over Sets of Control Flow Graphs,
Proceedings of the 10th International Conference on
Trust, Security and Privacy in Computing and Communications, pp. 181–189 (2011).
Dean, J., Grove, D. and Chambers, C.: Optimization of
Object-Oriented Programs Using Static Class Hierarchy
Analysis, Proceedings of the 9th European Conference
on Object-Oriented Programming, pp. 77–101 (1995).
Newman, M. E. J.: Fast algorithm for detecting community structure in networks, Physical Review E, Vol. 69,
No. 6, pp. 1–5 (2004).
Ural, E., Umut, T. and Feza, B.: Object Oriented Software Clustering Based on Community Structure, Proceedings of the 18th Asia-Paciﬁc Software Engineering
Conference, pp. 315–321 (2011).
Clauset, A., Newman, M. E. J. and Moore, C.: Finding
community structure in very large networks, PhysicalReview E, Vol. 70, No. 6 (2004).
Brandes, U., Delling, D., Gaertler, M., Robert, G., Hoefer, M., Nikoloski, Z. and Wagner, D.: On Modularity
Clustering, IEEE Transactions on Knowledge and Data
Engineering, Vol. 20, No. 2, pp. 172–188 (2008).
Wu, J., Hassan, A. and Holt, R.: Comparison of clustering algorithms in the context of software evolution, Proceedings of the 21st International Conference on Software Maintenance, pp. 525–535 (2005).
Wen, Z. and Tzerpos, V.: An eﬀectiveness measure forsoftware clustering algorithms, Proceedings of 12th International Workshop on Program Comprehension, pp.
194–203 (2004).
Tzerpos, V. and Holt, R.: MoJo: a distance metricfor software clusterings, Proceedings of the 6th Working Conference on Reverse Engineering, pp. 187–193

c 2015 Information Processing Society of Japan⃝(1999).

27