Vol.2016-SE-192 No.2
Vol.2016-EMB-41 No.2
2016/6/2

৘ใॲཧֶձ‫ڀݚ‬ใࠂ
IPSJ SIG Technical Reportεςοϓ࣮ߦ࣌ʹ஫໨͢΂͖ม਺Λఏࣔ͢ΔσόοΨͷ։ൃ෌Ӭ ਅ࢘1,a)ੴඌ ོ1,b)Ҫ্ ࠀ࿠1,c)֓ཁɿσόοάͱ͸ɼ։ൃऀ͕‫ظ‬଴ͨ͠௨Γʹಈ࡞͠ͳ͍ϓϩάϥϜʹରͯͦ͠ͷ‫ݪ‬ҼΛ෼ੳ͠ղফ͢ΔΑ͏ʹमਖ਼Λߦ͏࡞‫͋Ͱۀ‬Δɽຊ‫Ͱڀݚ‬͸ɼ։ൃऀ͕σόοΨΛ࢖༻ͯ͠෼ੳʹඞཁͳม਺ΛӾཡ͢Δ࡞‫ʹۀ‬අ΍࣌ؒ͢ͱ࿑ྗΛ࡟‫͢ݮ‬ΔͨΊʹɼ࣍ͷ໋ྩͰ࢖༻͞ΕΔม਺Λ஫໨͢΂͖ม਺ͱͯ͠ఏࣔ͢Δม਺ϏϡʔΛఏҊ͢Δɽ͜͜Ͱͷ࣍ͷ໋ྩͱ͸εςοϓ࣮ߦΛ 1 ճ࣮ߦͨ͠ͱ͖ʹ࣮ߦ͞ΕΔ໋ྩ‫܈‬Λࢦ͢ɽ·ͨɼ࢖༻͞ΕΔม਺ͱ͸஋ΛϝϞϦ͔ΒಡΈͩ͞ΕΔม਺ͷ͜ͱͰ͋ΔɽEclipse JDT Ͱར༻Ͱ͖ΔσόοΨͷม਺Ϗϡʔͷ‫ػ‬ೳΛ֦ுͯ͠ɼఏҊ͢Δม਺Ϗϡʔͷ‫ػ‬ೳΛ࣮‫ͨ͠ݱ‬ɽࢼ࡞ͨ͠ม਺Ϗϡʔ͕ม਺ͷฒͼʹ༩͑ΔӨ‫ڹ‬ΛධՁ͢ΔͨΊʹɼ࣮ࡍͷόάࣄྫΛूΊͨϕϯνϚʔΫ Defects4J ʹऩ࿥͞Εͨ
4 ͭͷࣄྫͱɼत‫͞༻࢖Ͱۀ‬Ε͍ͯΔ‫ࡐڭ‬ϓϩάϥϜ Lifegame ͷಈ࡞ͷ෼ੳʹରͯ͠ద༻͠ɼม਺͕ଟ਺
࢖ΘΕΔϝιουதͰ͋ͬͯ΋ɼ࣍ͷ໋ྩͰ࢖༻͞ΕΔগ਺ͷม਺ΛϏϡʔͷઌ಄ʹूΊΒΕΔ͜ͱΛ֬ೝͨ͠ɽ

1. ͸͡Ίʹ

Ψ͸ɼ։ൃऀ͕ࢦఆͨ͠ϒϨʔΫϙΠϯτͰϓϩάϥϜͷ
࣮ߦΛҰ࣌ఀࢭ͠ɼ࣮ߦதͷϓϩάϥϜͷ͋Δ࣌఺Ͱͷϝιϑτ΢ΣΞͷ։ൃ͓Αͼιϑτ΢ΣΞอकʹ͓͚Δ։

ϞϦͷঢ়ଶΛ֬ೝ͢Δ͜ͱΛՄೳͱ͢Δɽม਺ʹෆਖ਼ͳ஋ൃऀͷ࡞‫ۀ‬ͷ 1 ͭʹσόοά͕͋Δɽσόοάͱ͸ɼϓϩ΍૝ఆ֎ͷ஋͕ೖ͍ͬͯΔͱͦΕ͕όάͷ‫ݪ‬ҼͱͳΔ͜ͱάϥϜʹରͯ͠ςετೖྗΛ༩͑ͨͱ͖ʹ‫ظ‬଴ͨ͠௨Γʹ͕ଟ͍ͷͰɼ։ൃऀ͸ɼσόοΨʹରͯ͠εςοϓ࣮ߦΛಈ࡞͠ͳ͍໰୊ɼ͢ͳΘͪόάͷ‫ݪ‬ҼΛಛఆ͠ɼͦͷ‫ݪ‬Ҽࢦࣔ͢Δ͜ͱʹΑͬͯϓϩάϥϜͷ࣮ߦΛ 1 ߦͣͭਐΊΛղফ͢ΔΑ͏ʹର৅ϓϩάϥϜͷमਖ਼Λߦ͏࡞‫͋Ͱۀ‬Δɽ

ͳ͕Βɼม਺ʹ‫ظ‬଴௨Γͷ஋͕ೖ͍ͬͯΔ͔Ͳ͏͔Λ֬ೝϓϩάϥϜͷόάʹΑͬͯൃੜ͢Δো֐ʹΑΔଛࣦ͸Ұൠ͢Δɽʹେ͖͘ɼ·ͨɼͦͷमਖ਼ʹඞཁͳίετ΋େ͖͍ [1]ɽͦ

σόοΨʹ͓͍ͯม਺ͷ஋Λ֬ೝ͢Δ‫ػ‬ೳ͸ม਺ϏϡʔͷͨΊɼόά͕ൃ‫͞ݟ‬Εͨ৔߹ɼͦΕΛऔΓআ͘࡞‫ۀ‬͸ආͱ‫ݺ‬͹Ε͍ͯΔ [3]ɽม਺Ϗϡʔ͸ɼϓϩάϥϜͷதʹग़‫ݱ‬͚ΒΕͳ͍͜ͱ͕ଟ͍ɽ

͢Δม਺໊ͱͦͷ஋Λ։ൃऀʹఏࣔ͢ΔɽJava ͷ։ൃ‫ڥ؀‬σόοά࡞‫ۀ‬͸ɼόάʹΑͬͯҾ͖‫͜͞ى‬ΕΔ໰୊Λ࠶Ͱ͋Δ Eclipse JDT ͷσόοά‫͞૷࣮ʹڥ؀‬Ε͍ͯΔม਺

‫͢ݱ‬ΔΑ͏ͳςετೖྗͷಛఆɼͦΕΛखֻ͔Γͱͨ͠Ϗϡʔͷ৔߹͸ɼ‫ߦ࣮ࡏݱ‬தͷϝιουͰࢀরՄೳͳϩʔόάͷ‫ݪ‬Ҽͷ෼ੳɼ໰୊ͷ͋Δ໋ྩͷҐஔͷಛఆɼόάͷΧϧม਺ͷ໊લͱ஋ͷ૊͕දࣔ͞Εɼ·ͨɼΦϒδΣΫτ

मਖ਼ɼͦͯ͠ςετʹΑΔमਖ਼ͷ֬ೝͱ͍͏खॱ͔Βͳʹؔͯ͠͸ͦͷߏ੒ཁૉͰ͋ΔϑΟʔϧυͷҰཡ͕ɼ഑ྻ

Δ [2]ɽσόοΨ͸ɼ͜ΕΒͷ࡞‫ۀ‬ͷதͰ΋ɼόάͷ‫ݪ‬Ҽͷʹؔͯ͠͸ͦͷཁૉͷ஋͕ɼϦετͱͯ͠දࣔ͞ΕΔɽ෼ੳ΍Ґஔͷಛఆͷࡍʹ࢖༻͞ΕΔࢧԉπʔϧͰ͋Δɽ‫ܭ‬։ൃऀ͕Ӿཡ͢Δม਺Ϗϡʔͷ߲໨ͷ਺͸ɼͦͷ໋ྩͷࢉ‫͢ߦ࣮͕ػ‬Δຊདྷͷ໋ྩ͸‫ػ‬ց‫͋Ͱޠ‬Δ͕ɼσόοΨ͸

஍఺ͰࢀরՄೳͳม਺ͷ਺ͱɼͦͷதʹ‫·ؚ‬ΕΔΦϒδΣ։ൃऀ͕‫ه‬ड़ͨ͠ϓϩάϥϛϯά‫ޠݴ‬ͷද‫ݱ‬Λ࢖࣮ͬͯߦ

Ϋτ΍഑ྻͷ਺ɼσʔλߏ଄ͷෳࡶ͞ʹΑܾͬͯ·ΔɽϓதͷϓϩάϥϜͷ৘ใΛௐࠪ͢Δ͜ͱΛՄೳͱ͢Δ [3]ɽϩάϥϜͷ࣮ߦதͷ৘ใΛ࢖ͬͨӾཡͷͨΊͷࢧԉͱ͍͏σόοΨʹ͸༷ʑͳ‫ܗ‬ଶ͕͋Δ͕ɼEclipse[4] ͳͲͷ౷ͷ͸ߦΘΕ͍ͯͳ͍ͨΊɼ։ൃऀ͸ม਺Ϗϡʔ͔Β‫ڵ‬ຯ͋߹։ൃ‫͘޿ͯ͠ͱڥ؀‬ར༻͞Ε͍ͯΔσόοΨ͸ϒϨʔΫΔม਺Λࣗ෼Ͱ୳͢ඞཁ͕͋Δɽͨͱ͑͹ array[idx] ͱϙΠϯτͱ‫ݺ‬͹ΕΔ‫ػ‬ೳΛఏ‫͍ͯ͠ڙ‬Δɽ͜ΕΒͷσόο
1
a)
b)
c)

େࡕେֶ
Osaka Uniersity, Suita, Osaka 565-0871, Japant-shinji@ist.osaka-u.ac.jp
ishio@ist.osaka-u.ac.jp
inoue@ist.osaka-u.ac.jp

c 2016 Information Processing Society of Japan͍͏഑ྻͷࢀরΛ͍ͯ͠Δ໋ྩ͕͋ͬͨͱ͖ɼEclipse JDT͸୯७ʹ array ͱ͍͏഑ྻͷશཁૉͷϦετͱม਺ idxͷ஋Λఏ‫͠ڙ‬ɼ։ൃऀ͕ͦͷத͔Βख࡞‫ Ͱۀ‬array[idx]ʹରԠ͢Δ஋ͷཁૉΛӾཡ͢Δඞཁ͕͋Δɽ·ͨɼΦϒδΣΫτͷϑΟʔϧυʹ͍ͭͯ΋ɼ͢΂ͯͷϑΟʔϧυ͕

1Vol.2016-SE-192 No.2
Vol.2016-EMB-41 No.2
2016/6/2

৘ใॲཧֶձ‫ڀݚ‬ใࠂ
IPSJ SIG Technical ReportΞϧϑΝϕοτॱͰදࣔ͞ΕɼͦΕΒͷத͔Β஫໨͢Δ஋

๏Ͱ͋ΔɽWhyline[7] ͸ɼOmniscient Debugging ͱಉ༷Λ։ൃऀ͕ௐ΂Δඞཁ͕͋ΔɽϓϩάϥϜʹॻ͔Εͨࣜͷʹ࣮ߦཤྺΛ͢΂ͯอଘ͓͖ͯ͠ɼͦͷཤྺʹର࣭ͯ͠໰

‫͔ܗ‬Βͦͷ஋ΛՄࢹԽ͢ΔΠϯεϖΫλͱ͍͏πʔϧ΋ఏΛॏͶ͍ͯ͘͜ͱͰ໰୊ՕॴΛߜΓࠐΉσόοΨͰ͋Δɽ

‫͞ڙ‬Ε͍ͯΔ͕ɼ։ൃऀ͕಺༰ΛӾཡ͍ͨࣜ͠Λ‫ݸ‬ผʹࢦ࣭໰಺༰͸࣮ߦཤྺͷதͰͷ੍‫ޚ‬ϑϩʔ΍σʔλϑϩʔʹ

ఆ͢Δඞཁ͕͋Δɽ

ର͢ΔΫΤϦͰ͋Γɼͳͥର৅஍఺ʹ౸ୡͨ͠ͷ͔ɼͳͥຊ‫Ͱڀݚ‬͸ɼ։ൃऀ͕Ӿཡ͢Δඞཁͷ͋Δม਺Λ୳͠ग़

͋Δม਺ʹ͸ͦͷ஋͕ೖ͍ͬͯΔͷ͔ɼͱ͍࣭ͬͨ໰Λબ͢࡞‫ʹۀ‬අ΍࣌ؒ͢ͱ࿑ྗΛ࡟‫͢ݮ‬ΔͨΊʹɼ࣍ͷ໋ྩ

୒͢Δͱɼͦͷ࣭໰಺༰ʹ߹க͢ΔϓϩάϥϜ࣮ߦ্ͷ࣌Ͱ࢖༻͞ΕΔม਺Λ஫໨͢΂͖ม਺ͱͯ͠ఏࣔ͢Δม਺఺΁Ҡಈ͢Δ͜ͱ͕Ͱ͖Δɽ͜ͷํࣜ͸ɼϓϩάϥϜͷৼϏϡʔΛఏҊ͢Δɽ͜͜Ͱͷ࣍ͷ໋ྩͱ͸εςοϓ࣮ߦΛΔ෣͍ʹԾઆΛཱͯɼͦΕΛπʔϧ౳ʹΑΓ֬ೝ͢Δͱ͍

1 ճ࣮ߦͨ͠ͱ͖ʹ࣮ߦ͞ΕΔ໋ྩ‫܈‬Λࢦ͢ɽ·ͨɼ࢖༻͏ମ‫ܥ‬తͳσόοά࡞‫[ ۀ‬2] ͷҰछͰ͋Δͱߟ͑ΒΕΔɽ

͞ΕΔม਺ͱ͸஋ΛϝϞϦ͔ΒಡΈͩ͞ΕΔม਺Λࢦ͢ɽσʔλͷૢ࡞ʹ஫໨ͯ͠ϓϩάϥϜͷ࣮ߦΛ੍‫͢ޚ‬Δ

֤εςοϓͰ࣮ࡍʹ࢖༻͞ΕΔม਺͸ϏϡʔʹฒΜͩม਺σόοΨʹ͍ͭͯ΋‫ߦ͕ڀݚ‬ΘΕ͍ͯΔɽObject-Centricͷ͏ͪͷҰ෦Ͱ͋Δ͜ͱ͕ଟ͍͜ͱ͔ΒɼϓϩάϥϜͷ‫ن‬

Debugging[8] ͸ɼΦϒδΣΫτʹண໨ͨ͠σόοάख๏Ͱ໛͕େ͖͘, ͦΕʹ൐͍ࢀরՄೳͳม਺΋ଟ͘ͳͬͨͱ͠

͋Δɽ௨ৗͷσόοΨͰ͸ɼιʔείʔυ্ʹϒϨʔΫͯ΋ɼ։ൃऀ͸ม਺Ϗϡʔͷ্୺Λ֬ೝ͢Δ͚ͩͰɼ࢖༻

ϙΠϯτΛઃஔ͠ɼϓϩάϥϜͷ࣮ߦ͕ͦͷ஍఺ʹ౸ୡ͞ΕΔม਺ͷ஋Λਝ଎ʹ֬ೝ͢Δ͜ͱ͕Ͱ͖ΔΑ͏ʹͳΔɽ

ͨ͠ࡍʹɼϓϩάϥϜ͕ఀࢭ͢ΔɽҰํɼObject-Centric۩ମతʹ͸ɼEclipse JDT Ͱར༻Ͱ͖ΔσόοΨͷม਺

Debugging Ͱ͸ɼΦϒδΣΫτʹର͠ϒϨʔΫϙΠϯτ

Ϗϡʔͷ‫ػ‬ೳΛ֦ு͢Δ͜ͱͰ࣮‫ͨ͠ݱ‬ɽ͜ͷม਺ϏϡʔΛઃఆ͠ɼࢦఆͨ͠ΦϒδΣΫτʹରͯ͠มߋ͞Εͨࡍ͸ɼҰ࣌ఀࢭͨ͠ϓϩάϥϜ͔Βɼ࣍ʹ࣮ߦ͞ΕΔ໋ྩͷʹϓϩάϥϜ͕ఀࢭ͢Δ͜ͱΛՄೳͱ͍ͯ͠ΔɽRelativeϦετͱม਺ͷ஋Λऔಘ͠ɼσόοΨଆͰม਺ͷ஋Λ࢖ͬ

Debugging[9] ͸ɼ2 ͭͷྨࣅϓϩάϥϜʹಉ͡ೖྗΛ༩໋͑ͯྩΛٙࣅతʹ࣮ߦ͢Δ͜ͱͰɼσόοάର৅ϓϩάϥ࣮ͯߦΛൺֱ͠ɼҟͳΔಈ࡞͕‫؍‬ଌ͞Εͨ࣌఺ͰϓϩάϥϜࣗମͷঢ়ଶʹ͸Ө‫ڹ‬Λ༩͑ͣɼࢀর͞ΕΔϝϞϦྖҬͷϜͷ࣮ߦΛఀࢭ͢Δ͜ͱͰόάͷ঱ঢ়ͷൃੜ৔ॴΛಛఆ͢৘ใ͚ͩΛநग़͢ΔɽղੳՄೳͳൣғͰ࣮ࡍʹ࢖ΘΕΔม

Δٕज़Ͱ͋Δɽਖ਼͘͠ಈ࡞͍ͯͨ͠‫چ‬όʔδϣϯͷϓϩά

਺ɼΦϒδΣΫτ͓Αͼ഑ྻͷҰཡΛಛఆ͠ɼͦΕΒͷ໊ϥϜʹվมΛՃ͑ͨͱ͜Ζɼ৽όʔδϣϯͰ͸ਖ਼͘͠ಈ࡞

લͱ஋ΛϏϡʔͷઌ಄ʹҠಈͯ͠දࣔ͢Δɽ

͠ͳ͘ͳͬͨ৔߹ͳͲʹɼ‫چ‬όʔδϣϯͱ৽όʔδϣϯͷࢼ࡞ͨ͠ม਺Ϗϡʔ͕ม਺ͷฒͼʹ༩͑ΔӨ‫ڹ‬ΛධՁ࣮͢ߦΛൺ΂Δ͜ͱͰɼޮ཰తͳσόοά͕ՄೳͱͳΔɽ

ΔͨΊʹɼ࣮ࡍͷόάࣄྫΛूΊͨϕϯνϚʔΫ Defects4J࣮ߦதʹ‫؍‬ଌ͞Εͨม਺ͷ஋Λ࢖ͬͨҟৗσʔλͷൃੜʹऩ࿥͞Εͨ 4 ͭͷࣄྫͱɼत‫͞༻࢖Ͱۀ‬Ε͍ͯΔ‫ࡐڭ‬ϓͷ‫ݕ‬ग़΋·ͨɼσόοάࢧԉٕज़ͷ 1 ͭͰ͋Δɽͨͱ͑͹ϩάϥϜ Lifegame ͷಈ࡞ͷ෼ੳʹରͯ͠ద༻͠ɼ࣍ͷ໋

Daikon[10] ͸ϓϩάϥϜͷ࣮ߦΛ෼ੳ͠ɼͦͷ஋Ҭ͔ΒྩͰ࢖༻͞ΕΔม਺͕Ͳͷఔ౓ม਺Ϗϡʔͷઌ಄ʹू·ෆม৚݅Λਪఆ͢ΔπʔϧͰ͋Δɽ͋Β͔͡Ίࢼ‫ݧ‬σʔλΓɼ։ൃऀͷӾཡ࡞‫ۀ‬Λ୹ॖ͢Δ͜ͱ͕‫ظ‬଴Ͱ͖Δ͔Λఆ͔Βෆม৚݅Λਪఆ͓ͯ͘͜͠ͱͰɼ͜Ε·ͰͷೖྗʹͳྔతʹධՁ͢Δ࣮‫ݧ‬Λߦͬͨɽ͔ͬͨҟৗͳσʔλͷൃੜΛ‫ݕ‬ग़͢Δ͜ͱ͕ՄೳͰ͋Δɽ

Ҏ߱ɼ2 ষͰ͸ຊ‫ڀݚ‬ͷؔ࿈‫͍ͯͭʹڀݚ‬ड़΂Δɽ3 ষͰ͸ఏҊख๏ʹ͍ͭͯड़΂Δɽ4 ষͰ͸ఏҊख๏ʹର͢Δ
ධՁ࣮‫͍ͯͭʹݧ‬ड़΂Δɽ5 ষͰ͸·ͱΊʹ͍ͭͯड़΂Δɽ

2. ؔ࿈‫ڀݚ‬

3. ఏҊख๏
ຊ‫Ͱڀݚ‬͸ɼσόοΨʹΑΓҰ࣌ఀࢭͨ͠ϓϩάϥϜʹ
εςοϓ࣮ߦΛࢦࣔͨ͠ͱ͖ɼ࣍ͷҰ࣌ఀࢭ·Ͱʹ࢖༻͞
ΕΔม਺Λม਺Ϗϡʔͷઌ಄ʹ·ͱΊΔ‫ػ‬ೳΛ౥ࡌͨ͠σຊ‫ڀݚ‬͸ɼ։ൃऀ͕஫໨͢ΔͰ͋Ζ͏ม਺Λ΢Οϯυ΢

όοΨΛఏҊ͢Δɽม਺Ϗϡʔ͕ߦ͏ॲཧ͸ɼσόοάର্Ͱ༏ઌతʹදࣔ͢Δख๏Ͱ͋Δ͕ɼม਺ͷ஋ͷӾཡʹؔ৅ϓϩάϥϜͷ͋Δߦ l ͰϓϩάϥϜͷ࣮ߦΛఀࢭͨ͠ͱ

͢Δ‫ͯ͠ͱڀݚ‬͸ɼม਺ͷ஋Λऩू͠ՄࢹԽ͢Δํ๏͕ओ͖ɼͦͷҐஔͰϓϩάϥϜ͕ࢀরՄೳͳϝϞϦྖҬͷத͔ͳ‫͍ͯͬͳͱڀݚ‬ΔɽAlsallakh Β [5] ͸ɼTracepoint ͱΒදࣔ͢΂͖ྖҬΛબఆ͠ɼ։ൃऀ͔ΒӾཡͰ͖ΔϝϞϦ‫ݺ‬͹ΕΔɼ࣮ߦ࣌ͷม਺ͷ஋Λ‫؍‬ଌ͢ΔͨΊͷϒϨʔΫϙྖҬͷϦετ V (l) Λ‫͢ࢉܭ‬Δॲཧͱߟ͑ΒΕΔɽ

ΠϯτͷҰछΛఏҊͨ͠ɽϓϩάϥϜͷ࣮ߦ͕ Tracepoint

Java ϓϩάϥϜ͕͋Δϝιου m ͷதͷ͋Δߦ l Ͱఀʹ౸ୡͨ࣌͠఺Ͱͷม਺ͷ஋Λ‫ه‬࿥͍͖ͯ͠ɼ࣌ؒͷ‫ܦ‬աࢭͨ͠ͱ͖ɼ͋Δϝιου͕ఆٛ͞ΕͨΫϥεΛ c ͱ͢ΔʹΑͬͯม਺ͷ஋͕มԽ͢Δ͜ͱΛՄࢹԽ͢Δख๏Ͱ͋ͱɼҎԼͷϝϞϦྖҬ͕ࢀরՄೳͰ͋Δɽ

ΔɽOmniscient Debugging [6] ͸ɼϓϩάϥϜͷ࣮ߦΛ͢΂ͯ‫ه‬࿥͓͖ͯ͠ɼϓϩάϥϜͷঢ়ଶΛ࠶‫͢ݱ‬Δ͜ͱͰ೚ҙͷ஍఺ͷϓϩάϥϜͷঢ়ଶΛӾཡՄೳͱ͢Δσόοάखc 2016 Information Processing Society of Japan• m ͕ΠϯελϯεϝιουͰ͋Δ৔߹ɼϝιουΛ࣮ߦ͢ΔΦϒδΣΫτ΁ͷࢀর this• m ͷҾ਺2

Vol.2016-SE-192 No.2
Vol.2016-EMB-41 No.2
2016/6/2

৘ใॲཧֶձ‫ڀݚ‬ใࠂ
IPSJ SIG Technical Report• m ͷதͰએ‫͞ݴ‬ΕͨϩʔΧϧม਺

ΕΔม਺΍഑ྻͷཁૉɿ͜ΕΒ͸໋ྩͷ࣮ߦॱংʹै• c Ͱએ‫͞ݴ‬ΕͨϑΟʔϧυ͍ɼࢀরॱʹදࣔ͢Δɽ• c ͷ਌ΫϥεͷϑΟʔϧυͷ͏ͪɼՄࢹੑͷ੍໿Λຬͨ͢΋ͷ• Մࢹੑͷ੍໿Λຬͨ͢ static ϑΟʔϧυ( 2 ) ্‫ه‬Ҏ֎ͷม਺ɿ͜ΕΒ͸ैདྷͷม਺Ϗϡʔͱಉ͡ॱ
൪Ͱදࣔ͢Δɽϝιου m ͱ໋ྩߦ l ͔Βม਺Ϗϡʔʹදࣔ͢

Java Ͱ͸ఆ਺͸ final म০ࢠΛ͚ͭͨม਺Ͱද‫͞ݱ‬ΕΔ

Δ ม ਺ ͷ Ϧ ε τ V (l) Λ ‫ ٻ‬Ί Δ ૢ ࡞ ͸ ɼEclipse4.5.1

ͨΊɼఆ਺΋ࢀরՄೳͳม਺ʹ‫·ؚ‬ΕΔɽ·ͨɼ্‫ه‬ͷࢀʹ ͓ ͍ ͯ JavaStackFrameContentProvider Ϋ ϥ ε ͷরՄೳͳϝϞϦྖҬ v Λ༻͍ͯɼҎԼʹྻ‫͢ڍ‬ΔϝϞϦྖ

getAllChildren ϝιουʹ࣮૷͞Ε͍ͯΔɽ͜ͷϝιοҬ΋ࢀরՄೳͰ͋Δɽ

υ͸σόοάର৅ϓϩάϥϜʹΞΫηεͯ͠ɼm ΍ l ͷ• v Λ௨ͯ͠ΞΫηεՄೳͳϑΟʔϧυ৘ใΛ࣋ͭ JDIStackFrame ΦϒδΣΫτ͔ΒɼV (l) ʹର• v Λ௨ͯ͠ΞΫηεՄೳͳ഑ྻͷ‫ݸ‬ผͷཁૉԠ͢ΔΦϒδΣΫτͷ഑ྻΛ‫͢ࢉܭ‬ΔॲཧΛ࣮૷͍ͯ͠

ΦϒδΣΫτࢀর‫ͼٴ‬഑ྻࢀর͸ɼଞͷΦϒδΣΫτͷ

Δɽຊ‫Ͱڀݚ‬͸͜ͷϝιουΛ֦ுͯ͠ɼม਺Λฒ΂ସ͑ϑΟʔϧυ΍഑ྻͷཁૉʹͳΓ͏ΔͨΊɼࢀরՄೳͳม਺

ͨ V (l) Λ‫͢ࢉܭ‬ΔॲཧΛ࣮‫ͨ͠ݱ‬ɽ΍഑ྻͷཁૉ͸ࢀরՄೳͳม਺Λ‫֊ͨ͠ͱ఺ج‬૚ߏ଄ͱ͠
ͯද‫͖Ͱݱ‬Δɽ
ຊ‫͢࡞ࢼͰڀݚ‬ΔσόοΨͷ‫͋Ͱૅج‬Δ Eclipse JDT ͷैདྷͷม਺ϏϡʔͰ͸ɼϓϩάϥϜ͕͋Δϝιου m ͷ͋Δߦ l Ͱఀࢭͨ͠ͱ͖ɼҎԼͷ߲໨Λදࣔ͢Δɽ• m ͕ΠϯελϯεϝιουͰ͋Δ৔߹ɼm Λ࣮ߦ͍ͯ͠ΔΦϒδΣΫτࢀর thisɽ• m ͷதͰએ‫͞ݴ‬Εɼl ΑΓ΋લʹ஋Λ୅ೖ͞ΕͨϩʔΧϧม਺V (l) ͷ۩ମతͳ‫ࢉܭ‬खॱ͸ҎԼͷ௨ΓͰ͋Δɽ( 1 ) ϓϩάϥϜͷҰ࣌ఀࢭ৔ॴʹରԠ͢ΔΫϥεϑΝΠϧ
Λಛఆ͢Δ( 2 ) ಛఆͨ͠ΫϥεϑΝΠϧ͔ΒόΠτίʔυ໋ྩΛಡΈऔΔ( 3 ) ಡΈऔͬͨόΠτίʔυ໋ྩΛղੳ͠, ࢖༻͞ΕΔม
਺Λಛఆ͢ΔҎ߱ɼ֤खॱʹ͍ͭͯॱ൪ʹઆ໌͠ɼ࠷‫্૷࣮ʹޙ‬ͷ੍‫ݶ‬ʹ͍ͭͯड़΂Δɽ

this Λ௨ͯ͠ࢀরՄೳͳϑΟʔϧυ͸ɼthis ͷࢠཁૉͱͯ͠ this ͷπϦʔߏ଄಺ʹදࣔ͞ΕΔɽstatic ϑΟʔϧυ΍ final Λ෇༩ͨ͠ϑΟʔϧυม਺͸ɼࢀরՄೳͰ΋ม਺Ϗϡʔʹ͸දࣔ͞Εͳ͍ɽຊ‫Ͱڀݚ‬ఏҊ͢Δม਺ϏϡʔͰ͸ϓϩάϥϜ͕ϝιουm ͷ͋Δߦ l Ͱఀࢭͨ͠ͱ͖ɼैདྷͷม਺ϏϡʔͰදࣔ͞
ΕΔ΋ͷʹՃ͑ɼ͞ΒʹҎԼͷ߲໨Λදࣔ͢Δɽ

3.1 ϓϩάϥϜͷҰ࣌ఀࢭ৔ॴʹରԠ͢ΔΫϥεϑΝΠ
ϧͷಛఆϓϩάϥϜͷ࣮ߦ͕Ұ࣌ఀࢭͨ͠ͱ͖ɼͦͷ໋ྩߦ l ʹ‫ه‬ड़͞Ε໋ͨྩΛ஌ΔͨΊʹɼ·ͣఀࢭҐஔͷΫϥε͕ͲͷΫϥεϑΝΠϧͰ͋Δ͔Λಛఆ͢Δɽ

Java ͸࣮ߦ࣌ʹϑΝΠϧ໊౳͔Β೚ҙͷΫϥεΛϩʔ• l ͱಉҰߦʹ͋Δ໋ྩΛ࣮ߦͨ͠ͱ͖ʹʢσόοΨʹ͓υ͢Δ࢓૊ΈΛ࣋ͭͨΊɼ୯७ʹ࣮ߦ࣌ʹ༩͑ΒΕͨΦ

͚Δ Step Over ૢ࡞ΛҰ౓͚ͩద༻ͨ͠ͱ͖ʹʣ஋Λϓγϣϯ΍ର৅ϓϩάϥϜͷ‫ه‬ड़͚͔ͩΒͰ͸ΫϥεΛࢀর͞ΕΔΦϒδΣΫτͷϑΟʔϧυ΍഑ྻͷཁૉɽ

൑ผ͢Δ͜ͱ͕Ͱ͖ͳ͍ɽͦͷͨΊɼຊ‫Ͱڀݚ‬͸ɼJavaͨͩ͠ɼstatic ΍ final Λ෇༩͞ΕͨϑΟʔϧυม

Debugger Interface (JDI) ͱ‫ݺ‬͹ΕΔσόοάର৅ϓϩά਺͸আ͘ɽϥϜͷԾ૝ϚγϯʹΞΫηε͢ΔͨΊͷΠϯλϑΣʔεΛ্‫ه‬ͷ߲໨͸ैདྷͷม਺Ϗϡʔʹ͓͍ͯπϦʔߏ଄ͷதʹ࢖༻ͯ͠ɼσόοάର৅ϓϩάϥϜΛ࣮ߦ͍ͯ͠Δ JavaͷΈ͕͋ͬͨɼຊ‫Ͱڀݚ‬ఏҊ͢Δม਺ϏϡʔͰ͸πϦʔߏԾ૝ϚγϯͰҎԼͷॲཧΛ࣮ߦͤ͞Δɽ଄಺ͷม਺Λ࢒ͨ͠··‫ݸ‬ผʹπϦʔߏ଄֎ʹ௥Ճ͢Δɽ(1) ‫ ࡏ ݱ‬ϝ ι ο υ Λ ࣮ ߦ த ͷ Ϋ ϥ ε ʹ ର Ԡ ͢ Δྫ͑͹ɼobj.var ͱ͍͏ϑΟʔϧυม਺΍ num[2] ͱ͍͏

java.lang.Class ΦϒδΣΫτΛऔಘ͢Δɽ഑ྻͷཁૉ͸ɼैདྷͷม਺ϏϡʔͰ͸ obj ΍ num ͷ߲໨( 2 ) Class ΦϒδΣΫτ͕࣋ͭ ProtectionDomain ΦϒΛల։ͨ͠πϦʔͷதʹ͔͠ଘࡏ͠ͳ͔͕ͬͨɼຊ‫Ͱڀݚ‬δΣΫτΛऔಘ͠ɼͦͷΫϥεͷಡΈग़͠‫ݩ‬Λද‫͢ݱ‬ఏҊ͢Δม਺ϏϡʔͰ͸ɼobj.var ΍ num[2] ͱ͍͏ಠཱ

Δ CodeSource ΦϒδΣΫτΛऔಘ͢Δɽ

߲ͨ͠໨ΛπϦʔ֎ʹ௥Ճ͢Δɽैདྷͷม਺Ϗϡʔͷม਺ͷදࣔॱ͸ҎԼͷ௨ΓͰ͋Δɽ( 1 ) ϩʔΧϧม਺ɿม਺ͷએ‫ॱݴ‬( 2 ) ϑΟʔϧυม਺ɿΞϧϑΝϕοτॱҰํɼຊ‫Ͱڀݚ‬ఏҊ͢Δม਺Ϗϡʔͷม਺ͷදࣔॱ͸ҎԼͷ௨ΓͰ͋Δɽ( 1 ) ߦ l ͱಉҰߦʹ͋Δ໋ྩΛ࣮ߦͨ͠ͱ͖ʹ஋Λࢀর͞c 2016 Information Processing Society of Japan( 3 ) ಘΒΕͨ CodeSource ΦϒδΣΫτͷ getLocation()ϝιουΛ࢖༻ͯ͠ɼΫϥεΛಡΈग़͖ͯͨ͠ϑΝΠ
ϧͷ URL Λऔಘ͢Δɽ( 4 ) URL ʹରͯ͠ toExternalForm ϝιουΛ‫ͼݺ‬ग़ͯ͠จࣈྻද‫ʹݱ‬ม‫͠׵‬ɼJDI Λ௨ͯ͡σόοΨଆ͕ͦͷจࣈྻද‫ݱ‬ΛಘΔɽ
͜ͷํࣜͰಘΒΕͨ URL ͸ɼ‫্ػࢉܭ‬ͷ೚ҙͷσΟϨ3

Vol.2016-SE-192 No.2
Vol.2016-EMB-41 No.2
2016/6/2

৘ใॲཧֶձ‫ڀݚ‬ใࠂ
IPSJ SIG Technical ReportΫτϦ͋Δ͍͸ JAR ϑΝΠϧͷத͔ΒಡΈͩ͞ΕͨΫϥεϑΝΠϧΛҰҙʹಛఆ͓ͯ͠ΓɼJava ඪ४ϥΠϒϥϦͷ

URLClassLoader ΫϥεΛ࢖͏͜ͱͰͦͷϑΝΠϧͷ಺༰ද 1

ASM ʹ͓͚ΔόΠτίʔυ໋ྩͷ෼ྨ

Table 1 Categories of bytecode instructions in ASMछྨॲཧMETHOD INSN

ϝιου‫ͼݺ‬ग़͠

INVOKE DYNAMIC INSN

ϝιου‫ͼݺ‬ग़͠

FIELD INSNϑΟʔϧυૢ࡞

όΠτίʔυ໋ྩͷಡΈऔΓ͸ɼASM*1 ͱ͍͏ Java ό

INSN

໋ྩॲཧ

Πτίʔυͷૢ࡞΍෼ੳΛߦ͏ͨΊͷϥΠϒϥϦΛ༻͍ͯ

LOOKUPSWITCH INSN৚݅෼‫ذ‬

࣮૷ͨ͠ɽखॱ͸ҎԼͷ௨ΓͰ͋Δɽ

TABLESWITCH INSN৚݅෼‫ذ‬MULTIANEWARRAY INSN഑ྻૢ࡞ΛσόοΨଆʹಡΈࠐΉɽ

3.2 ΫϥεϑΝΠϧͷόΠτίʔυ໋ྩͷಡΈऔΓ( 1 ) ղੳର৅ͷΫϥεϑΝΠϧΛೖྗͱͯ͠ɼASM ͷClassNode ΦϒδΣΫτΛऔಘ͢Δɽ͜ͷΦϒδΣ

LDC INSNఆ਺ͷϩʔυ

Ϋτ͸ɼΫϥε಺ʹએ‫͞ݴ‬Εͨ͢΂ͯͷϝιουɼϝ

INT INSN

int ‫ܕ‬ม਺ͷૢ࡞ιου͝ͱͷ໋ྩΛอ࣋͢ΔπϦʔߏ଄Ͱ͋Δɽ

TYPE INSN‫ܕ‬Ωϟετ( 2 ) ࣮ߦ͕Ұ࣌ఀࢭͨ͠ϝιουͷ໊લͱҾ਺ͷ‫ܕ‬৘ใΛ

JUMP INSN৚݅෼‫ذ‬ɼδϟϯϓ໋ྩ

JDIStackFrame ΦϒδΣΫτ͔Βऔಘ͠ɼClassNode

IINC INSN

ม਺ͷΠϯΫϦϝϯτ

VAR INSNϩʔΧϧม਺ͷಡΈॻ͖

FRAMEɼLABELɼLINEԿ΋͠ͳ͍͕อ࣋͢Δϝιουͷத͔ΒରԠ͢ΔϝιουΛ‫ͭݟ‬͚Δɽ( 3 ) ‫͚ͨͭݟ‬ϝιουͷ໋ྩϦετΛௐ΂ɼϓϩάϥϜͷ
ఀࢭՕॴʹߦ൪߸͕Ұக͢Δ໋ྩͷ։࢝ҐஔΛ͢΂ͯ΋͠ଘࡏ͍ͯ͠ͳ͚Ε͹ JDI Λ௨ͯ͡σόοάର৅ϓϩྻ‫͢ڍ‬ΔɽάϥϜʹΞΫηε͠ɼ஋ͷίϐʔΛ C(v) ͱ͢Δɽม਺ vҎ্ͷखॱͰߦ൪߸ͷҰக఺Λ໋ྩͷ࣮ߦ։࢝఺ͱ͢Δɽ

ʹରͯ͠஋ͷॻ͖ࠐΈΛߦ͏৔߹͸ɼC(v) ͷ஋ͷΈΛॻߦ l ʹରͯ͠ɼෳ਺ͷόΠτίʔυ໋ྩ‫͕܈‬ಉҰߦʹରԠ͖͢‫͑׵‬ɼม਺ͷ஋Λॻ͖‫͑׵‬Δ৔߹ɼ͜ͷΩϟογϡʹ֨Δ৔߹͸ɼͦΕͧΕΛ໋ྩͷ࣮ߦ։࢝఺ͱ͢Δɽͨͱ͑͹ɼೲ͞Εͨίϐʔͷ஋ͷΈΛॻ͖‫͑׵‬ɼϓϩάϥϜͷ࣮ࡍͷ“for (int i = 0; i < 10; i++) {” ͱ͍͏ߦ͕͋ͬͨ

ม਺ͷ஋͸มߋ͠ͳ͍ɽ

৔߹ɼίϯύΠϧ͞ΕͨόΠτίʔυ͸ i = 0 ͷॳ‫ظ‬Խ۩ମతͳ‫ࢉܭ‬खॱͱͯ͠͸ɼදࣔ͢Δม਺ྻ V ͷॳ‫ظ‬ॲཧͱɼfor จͷຊମͷ࣮ߦऴྃ‫ޙ‬ͷ i++ ͷ࣮ߦͷ 2 ͭͷঢ়ଶΛۭͱ͠ɼ໋ྩͷ֤࣮ߦ։࢝఺ pi (1 ≤ i ≤ n) ʹ໋͍ͭྩ‫ʹ܈‬෼ׂ͞ΕΔɽຊ‫Ͱڀݚ‬͸ɼ͜ͷΑ͏ͳόΠτίʔͯҎԼͷॲཧΛ࣮ߦ͢Δɽυ໋ྩʹ͍ͭͯ͸ɼi = 0 ͱ i++ʹରԠ͢Δ 2 ͭͷ໋ྩ‫܈‬( 1 ) ม਺ͷίϐʔ C ΛۭͰॳ‫ظ‬Խ͢Δɽ

ͷ྆ํΛόΠτίʔυͰͷग़‫ͦʹॱݱ‬ΕͧΕղੳ͠ɼొ৔

( 2 ) Ծ૝ϓϩάϥϜΧ΢ϯλ pc Λ pi Ͱॳ‫ظ‬Խ͢Δɽ

ͨ͠ม਺ͷϦετΛ࿈݁ͯ͠࠷ऴతͳ V (l) Λ࡞੒͢Δɽ

( 3 ) ໋ྩҐஔ pc ʹ͋Δ໋ྩΛ࣮ߦ͠ɼV ͱ C ͷߋ৽Λߦͬͯ pc Λ 1 ໋ྩͿΜਐΊΔॲཧΛ‫܁‬Γฦ͢ɽ৚݅

3.3 όΠτίʔυ໋ྩ͔Βͷ࢖༻͞ΕΔม਺ͷಛఆલઅͰಛఆ໋ͨ͠ྩͷ࣮ߦ։࢝఺ू߹ P෼‫ʹྩ໋ذ‬ΑΓ࣍ʹ࣮ߦ͞ΕΔ໋ྩ͕ෳ਺ଘࡏ͢Δ৔=߹ɼͦΕͧΕͷ෼‫ذ‬ઌΛ୳ࡧ͢ΔͨΊʹ C Λෳ੡͠ɼ{p1 , p2 , ..., pn } ͷ֤఺ pi (1 ≤ i ≤ n) ͔Βɼผͷߦ൪߸֤෼‫ذ‬ઌͷ໋ྩ࣮ߦΛͦΕͧΕߦͬͯ V Λߋ৽͢Δɽͷ໋ྩʹ౸ୡ͢Δ·Ͱ໋ྩΛॱʹ࣮ߦ͠ɼࢀর͞ΕΔม਺

V ͦͷ΋ͷ͸ෳ੡ͤͣɼ֤෼‫ذ‬ઌͷ໋ྩΛਂ͞༏ઌͰ

ͷϦετΛ࡞੒͢Δɽͨͩ͠ɼ1 ߦͰ‫݁͢׬‬ΔΑ͏ͳ for࣮ߦͨ݁͠ՌΛॱ൪ʹ֨ೲ͢Δɽจ౳ʹΑ࣮ͬͯߦ͕ϧʔϓ͢Δ৔߹͸ɼͦͷϧʔϓΛҰपม਺Ϧετ V ͸ม਺ v Λࢀর͢Δ໋ྩ͕͋Ε͹ɼͦͷม͚࣮ͩߦ͢Δ΋ͷͱ͢Δɽ਺Λ V ʹొ࿥͢Δ͕ɼ‫ొʹط‬࿥͞Ε͍ͯΔ৔߹͸ॏෳͯ͠഑ྻͳͲͷࢀরΛਖ਼͘͠औΓѻ͏ʹ͸ɼ࢛ଇԋࢉ౳ͷ‫ܭ‬ొ࿥͸͠ͳ͍ɽ·ͨɼແ‫ݶ‬ϧʔϓͷධՁʹؕΔ͜ͱΛ๷ࢭࢉ΋࣮ߦ͠ͳ͚Ε͹ͳΒͳ͍ɽ͔͠͠ɼ୅ೖ໋ྩͳͲͷ෭

͢ΔͨΊɼϓϩάϥϜΧ΢ϯλ pc ͱͯ͠࢖༻ͨ͠஋͸‫ه‬࡞༻Λ௚઀σόοάର৅ͷϓϩάϥϜʹ࣮ߦͤͯ͞͠·͏࿥͓͖ͯ͠ɼಉ໋͡ྩͷ࣮ߦ͸ߴʑ 1 ճ͔͠ߦΘͳ͍΋ͷͱɼσόοάର৅ͷϓϩάϥϜͷঢ়ଶΛഁյͯ͠͠·͏ɽͱͨ͠ɽ࣮ߦ͕ఀࢭͨ͠‫ޙ‬ɼಘΒΕͨ V ʹɼ‫ݩ‬ͷม਺Ϧͦ͜Ͱɼຊ‫Ͱڀݚ‬͸ɼσόοάର৅ϓϩάϥϜͷϝϞϦྖετ͔Β V ͷཁૉΛऔΓআ͍ͨϦετΛ࿈݁ͯ͠ɼม਺

Ҭͷίϐʔ C Λ༻ҙ͢Δɽ͜ͷϝϞϦͷίϐʔ͸ɼ࣮ߦϏϡʔʹදࣔ͢Δม਺ͷϦετ V ΛಘΔɽΛ։࢝͢Δ࣌఺Ͱ͸ۭͱ͓͖ͯ͠ɼϝϞϦྖҬ v Λࢀর֤͢όΠτίʔυ໋ྩͷ࣮ߦ͸ɼ‫ج‬ຊతʹ͸όΠτίʔυΔ৔߹ʹͦͷίϐʔ C(v) ͕ଘࡏ͢Δ͔Ͳ͏͔Λ֬ೝ͠ɼͷ࢓༷௨ΓͰ͋ΔɽASM ʹ͓͚ΔόΠτίʔυ໋ྩͷ෼ྨΛද 1 ʹࣔ͢ɽ*1

http://asm.ow2.org/

c 2016 Information Processing Society of Japanό Π τ ί ʔ υ ໋ ྩ ͷ ͏ ͪ ɼIINC INSNɼVAR INSNɼ

4

Vol.2016-SE-192 No.2
Vol.2016-EMB-41 No.2
2016/6/2

৘ใॲཧֶձ‫ڀݚ‬ใࠂ
IPSJ SIG Technical Report

FIELD INSNɼINSN ͷ ৔ ߹ ͕ ม ਺ ͷ ಡ Έ ॻ ͖ Λ ߦ ͏ ɽ
IINC INSNɼVAR INSN ͷ৔߹͸ϩʔΧϧม਺ͷಡΈग़͕͠ɼFIELD INSN ͷ৔߹͸ϑΟʔϧυม਺ͷಡΈग़͕͠ɼINSN ͷ৔߹͸഑ྻͷཁૉͷಡΈग़͕͠ߦΘΕΔՄೳ
ੑ͕͋Δɽ͜ΕΒͷॲཧʹ͍ͭͯ͸ɼC(v) ͓Αͼ V ͷߋ৽Λߦ͏ɽϝιου‫ͼݺ‬ग़͠ʹ͍ͭͯ͸ɼ࣮ߦ͢Δ͜ͱʹΑͬͯԿΒ͔ͷ෭࡞༻͕ੜ͡ΔՄೳੑ͕͋ΔͨΊɼຊ‫Ͱڀݚ‬͸ϝιου‫ͼݺ‬ग़͠ͷ࣮ߦͦͷ΋ͷ͸ߦΘͳ͍΋ͷͱͨ͠ɽϝιουΛ࣮ߦ͠ͳ͍ͱϝιουͷฦΓ஋΋‫ͳ͖Ͱࢉܭ‬͍ͨΊɼศ্ٓͦͷ஋Λද‫͢ݱ‬Δ਺஋ unknown Λಋೖਤ 1ϑΟϘφον਺ྻΛ‫͢ࢉܭ‬ΔαϯϓϧϓϩάϥϜ

Fig. 1 An example program computing Fibonacci sequence
1: package test;
2: public class Main {3:public static void main(String[] args) {4:
5:
int[] fibo = new int[11];6:fibo[1] = 1;
7:
for (int i=2; i<=10; ++i) {8:fibo[i] = fibo[i-1] + fibo[i-2];
9:System.out.println(fibo[i]);
10:
}
11:
}
12: }

͠ɼunknown Λ‫ؚ‬Ήԋࢉ౳ͷ݁ՌΛ͢΂ͯ unknown ͱ͢Δ͜ͱͰɼ஋ͷ൑໌͢ΔൣғͰͷΈ໋ྩͷ࣮ߦΛ෼ੳ͢• ԋࢉ͸‫݁ࢉܭ‬ՌͷΈΛอଘ͓ͯ͠Γɼ‫ࢉܭ‬खॱ͸ࣔ͞

Δɽͨͱ͑͹ɼnumber ͱ͍͏഑ྻ͕͋Γɼnumber[1] ͷͳ͍ɽ͕ͨͬͯ͠ɼ഑ྻͷ‫ݸ‬ผͷཁૉͷಡΈग़͠ʹ͓஋͕ಡΈͩ͞ΕΔͱ͢ΔͱɼV ʹ͸ numer ͱ͍͏഑ྻม

͍ͯɼͨͱ͑͹ a[i+3] ͸ a[4] ͱ͍͏Α͏ʹɼఴ͑਺ͷࢀরͱ numer[1] ͱ͍͏഑ྻͷཁૉͷࢀর͕௥Ճ͞Εࣈ͸࠷ऴతͳ஋ͷΈΛग़͢ɽΔ͕ɼ஋ͱͯ͠ 1 Λฦ͢Α͏ͳϝιου one() Λ༻͍ͯ• ϝιου‫ͼݺ‬ग़͠͸ɼͨͩෆఆ஋Λฦ͢ѻ͍ͱ͍ͯ͠

number[one()] ͱ͍ͬͨ‫Ͱܗ‬ද‫͞ه‬Ε͍ͯΔ৔߹͸ม਺

Δɽϝιου‫ͼݺ‬ग़͠ʹΑͬͯϑΟʔϧυͷ஋ͳͲ͕

number Λ࢖༻͢Δ͜ͱ͸‫ݕ‬ग़Ͱ͖Δ͕ɼnumber[1] ͱ͍ߋ৽͞ΕΔՄೳੑ͸ߟྀ͍ͯ͠ͳ͍ɽ

͏߲໨͸௥Ճ͞Εͳ͍ɽม਺ͷ஋͕֬ఆ͢Δൣғɼͨͱ͑• ม਺ͷࢀরॱংΛόΠτίʔυ্Ͱͷ໋ྩͷग़‫ʹॱݱ‬͹ i=0 ͷ৔߹ʹ number[i+1] ͱ͍͏໋ྩ͕࣮ߦ͞ΕΔ৔

ґଘܾͯ͠ఆ͍ͯ͠ΔͨΊɼͨͱ͑͹ x ? y : z ͳ߹͸ɼม਺ numberɼi ͷࢀরʹଓ͚ͯ number[1] ͕ V ʹͲͷ৚݅෼‫ذ‬Λ൐͏ԋࢉͰͷม਺ͷࢀরॱং͕ιʔε௥Ճ͞ΕΔɽ

ίʔυ্ͷม਺ͷঢ়ଶͱҰக͢Δ͔Ͳ͏͔͸ɼίϯύΠϥʹґଘ͍ͯ͠ΔՄೳੑ͕͋Δɽ

3.4 ࣮૷্ͷ੍‫ݶ‬ຊ‫͚͓ʹڀݚ‬ΔόΠτίʔυͷղੳ͸ɼҎԼͷ੍‫ݶ‬Λ͍࣋ͬͯΔɽ

3.5 ࣮ߦྫ
࣮ߦྫͱͯ͠ɼϑΟϘφον਺ྻΛ‫͢ࢉܭ‬ΔϓϩάϥϜ

• for จͷॳ‫ظ‬Խࢠͱ৚݅અͳͲͰ 1 ߦͷιʔείʔυΛਤ 1 ʹࣔ͢ɽ7 ߦ໨ͷ for จͰ‫܁‬Γฦ͠ॲཧΛ࣮ߦ͕͠ෳ਺ͷόΠτίʔυ໋ྩͷϒϩοΫʹ෼ׂͯ͠ද‫ݱ‬͓ͯΓɼ8 ߦ໨Ͱ഑ྻʹॱ൪ʹ஋Λ୅ೖ͍ͯ͠Δɽ͜ͷα͞Ε͍ͯΔ৔߹͸ɼͦΕͧΕͷϒϩοΫΛ‫ݸ‬ผʹղੳϯϓϧϓϩάϥϜΛ࣮ߦ͠ɼϓϩάϥϜͷ 8 ߦ໨Ͱ࣮ߦ

͠ɼͦΕΒͷ໋ྩΛ͢΂ͯྻ‫͠ڍ‬ɼ࢖༻͞ΕΔՄೳੑΛҰ࣌ఀࢭͨ͠ঢ়‫گ‬ͷεΫϦʔϯγϣοτΛਤ 2 ʹࣔ͢ɽ

ͷ͋Δม਺ͱͯ͠ྻ‫͢ڍ‬ΔɽσόοΨࣗମ͸࣍ʹ࣮ߦม਺ i ͷ஋͸‫ ࡏݱ‬6 ͱͳ͓ͬͯΓɼ8 ߦ໨ͷ‫͞༻࢖Ͱࢉܭ‬͞ΕΔόΠτίʔυ໋ྩͷΠϯσΫεΛ͍࣋ͬͯΔ

ΕΔ഑ྻ fiboɼม਺ iɼ഑ྻͷཁૉ fibo[i-1] ʹରԠ͢

͕ɼASM ໋͕ྩ͝ͱͷόΠτίʔυͷΠϯσοΫε

Δ fibo[5]ɼfibo[i-2] ʹରԠ͢Δ fibo[4] ͷ஋͕ม਺Λಛఆ͢Δ‫ػ‬ೳΛఏ‫͔ͨͨͬͳ͍ͯ͠ڙ‬ΊͰ͋ΔɽϏϡʔͷ্͔Βॱ൪ʹදࣔ͞Ε͍ͯΔɽͦͯ͠ɼ͜ͷߦͰ• null ͕୅ೖ͞ΕͨΦϒδΣΫτͷࢀর΍ a[-1] ͷΑ͸࢖༻͞Εͳ͍ม਺ args ͕Ұ൪Լʹදࣔ͞Ε͍ͯΔɽม

͏ͳଘࡏ͠ͳ͍഑ྻཁૉ΁ͷࢀরͳͲɼෆਖ਼ͳϝϞϦ਺ fibo[5] ͷΑ͏ʹ࢖༻͞ΕΔཁૉΛ௚઀ม਺Ϗϡʔʹදࢀর͕ߦΘΕΔ৔߹͸ɼ୯ʹม਺Ϗϡʔʹ͸൓ө͠ͳࣔ͢Δ͜ͱͰɼ։ൃऀ͕ fibo ͷ഑ྻࢀর͔ΒπϦʔΛల͍͚ͩͱ͠ɼ͜Ε͔ΒΤϥʔ͕‫͖ى‬ΔՄೳੑͷใࠂ͸։ͯ͠ i ͷ஋ʹରԠ͢ΔҐஔΛ୳͢ͱ͍͏࡞‫ۀ‬Λෆཁͱ͠

ߦΘͳ͍ɽ

͍ͯΔɽ

• ৚݅෼‫ذ‬͸ɼ෼‫ذ‬ઌ͕֬ఆ͢Δ৔߹΋͢΂ͯͷ෼‫ذ‬ઌΛ୳ࡧ͢Δɽ‫ʹط‬ม਺ͷ஋͕֬ఆ͍ͯ͠Ε͹࿦ཧԋࢉͷ݁Ռ΋ಛఆͰ͖ΔͨΊɼ৚݅෼‫ذ‬ઌΛՄೳͳ‫ݶ‬Γ֬ఆ͢ΔΑ͏ͳ෼ੳ΋ՄೳͰ͋Δɽ

4. ධՁ࣮‫ݧ‬ຊ‫ͨ͠࡞ࢼͰڀݚ‬σόοΨʹΑΓɼ໋ྩ͝ͱʹ࢖༻͞Ε
Δม਺͕Ͳͷఔ౓Ϧετͷઌ಄ʹ‫·ݻ‬Δ͔Λఆྔతʹධ• ϑΟʔϧυͷ஋ͷ্ॻ͖ʹ͸ରԠ͍ͯ͠ͳ͍ɽϑΟʔՁ͢Δҝͷ࣮‫ݧ‬ΛߦͬͨɽධՁࢦඪͱ֤ͯ͠ม਺ͷʮม਺ϧυͷ஋ʹ͍ͭͯ͸ҟͳΔεϨουʹΑΔ্ॻ͖ͷՄϏϡʔ಺ͷҐஔʯͷ਺஋Λ࢖༻ͯ͠ɼEclipse 4.5.1 ඪ४Ͱೳੑ΋͋Γɼॻ͖ࠐ·Εͨ஋͕ͦͷ··࣍ʹಡΈग़͞ͷม਺ v ͷදࣔҐஔͱɼఏҊ͢Δม਺ϏϡʔͰͷม਺ v ͷΕΔอূ͕Ͱ͖ͳ͍ͨΊͰ͋ΔɽදࣔҐஔΛൺֱ͢Δɽ͜ͷ஋͕খ͍͞΄Ͳɼม਺ v ͕ม਺

c 2016 Information Processing Society of Japan

5

Vol.2016-SE-192 No.2
Vol.2016-EMB-41 No.2
2016/6/2

৘ใॲཧֶձ‫ڀݚ‬ใࠂ
IPSJ SIG Technical Reportਤ 2 αϯϓϧϓϩάϥϜʹର͢Δ࣮ߦྫͷεΫϦʔϯγϣοτɽҰ࣌ఀࢭ͍ͯ͠Δߦͷ

fibo[i-1] ͱ͍͏ࣜͰ࢖༻͞ΕΔม਺ fiboɼi ͕ม਺Ϗϡʔͷ্୺ʹදࣔ͞Ε͍ͯΔɽ
Fig. 2 A screenshot of an execution of the example program.

The variables viewshows variables fibo and i on the top because they are used by the expression
fibo[i-1] at the line where an execution is suspended.

Ϗϡʔͷ্ଆʹදࣔ͞Εɼ։ൃऀ͕ม਺Ϗϡʔ͔Β໨తͷม਺Λ୳͠ग़͢࿑ྗ͕খ͍͞ͱߟ͑ΔɽΕࢠʹͳ͍ͬͯΔ৔߹΋ಉ༷ʹͯ͠‫ٻ‬ΊΔɽධՁࢦඪͷ‫ܭ‬ଌର৅͸ɼϓϩάϥϜதͰ͋Δ஫໨͢ΔϝධՁࢦඪͰ͋Δม਺Ϧετ V தͷม਺ v ͷҐஔΛද͢ιουΛ 1 ͭબ୒͠ɼͦͷ 1 ճͷ࣮ߦΛ Step Into ‫ػ‬ೳͰ਺஋Λ P (v, V ) ͱ͢ΔɽP (v, V ) ͷ஋͸ม਺Ϗϡʔ಺ͷઌ։͔࢝Βऴྃ·Ͱ‫ܭ‬ଌ͢Δ΋ͷͱͨ͠ɽStep Into ‫ػ‬ೳ͸ɼ಄͔Β਺͑ͯԿ൪໨Ͱ͋Δ͔Ͱද͢ɽͭ·Γɼઌ಄͸ 1 Ͱϝιου‫ͼݺ‬ग़͕͋͠Δ৔߹ɼͦͷ‫ͼݺ‬ग़͠ઌ·Ͱ௥੻͋͢Δɽͨͱ͑͹ɼม਺ a ͕ม਺Ϧετ V (l) ʹ͓͍ͯઌ಄

Δεςοϓ࣮ߦͰ͋Δɽεςοϓ࣮ߦ͕ఀࢭ֤ͨ͠ߦ l ʹ͔Β 3 ൪໨ʹ͋Δͱ͖ɼP (a, V (l)) = 3 Ͱ͋ΔɽΦϒδΣ͓͍ͯɼEclipse JDT ͕࣋ͭैདྷͷม਺ϏϡʔͰಘΒΕΔΫτͷϑΟʔϧυ΍഑ྻͷ‫ݸ‬ผͷཁૉ͸πϦʔΛల։ͨ͠ม਺Ϧετ VE (l) ͱຊ‫͕ڀݚ‬ఏҊ͢Δม਺ϏϡʔͰಘΒதʹ͋ΔͷͰɼP (v, V ) ͸࣍ͷΑ͏ʹఆٛ͢ΔɽΕΔม਺Ϧετ V (l) Λऔಘ͠ɼl ͷ࣮ߦதʹࢀর͞ΕΔ( 1 ) ϑΟʔϧυɿͦͷϑΟʔϧυΛอ࣋͢ΔΦϒδΣΫτ

֤ม਺ v ʹ͍ͭͯ P (v, VE (l)),P (v, V (l)) Λ‫ٻ‬ΊͨɽStepo ͷҐஔ P (o, V ) ʹɼϑΟʔϧυ಺Ͱͷม਺ͷҐஔΛInto ‫ػ‬ೳ͸ϥΠϒϥϦͷϝιου౳΋εςοϓ࣮ߦͯ͠Ճࢉͨ͠΋ͷɽ͠·͏ͨΊɼEclipse ඪ४ͷ Step Filtering ‫ػ‬ೳΛར༻͠( 2 ) ഑ྻͷཁૉɿͦͷཁૉΛ֨ೲ͢Δ഑ྻ a ͷҐஔҐஔ

ͯ”java.*”ͳͲͷඪ४ύοέʔδɼςετ࣮ߦ༻ͷ JUnit

P (a, V ) ʹɼ഑ྻ಺෦Ͱͷॱংʢఴ͑ࣈ+1 ͷ஋ʣΛՃύοέʔδ͸‫؍‬ଌର৅͔Βআ֎ͨ͠ɽ·ͨɼεςοϓ࣮ࢉͨ͠΋ͷɽ

ߦΛߦ͏࡞‫͍ͯͭʹۀ‬͸ɼDebugSetEventListener Πϯ͜ΕΒͷ஋͸ɼ֘౰͢ΔϑΟʔϧυ͋Δ͍͸഑ྻͷཁૉλʔϑΣʔεΛ༻͍ͯࣗಈతʹεςοϓ࣮ߦΛߦ͏ॲཧΛΛ୳ͯ͠ม਺ϏϡʔͷඞཁͳཁૉͷΈπϦʔΛల։ͨ͠‫ه‬ड़ͨ͠ɽ

ͱ͖ʹಘΒΕΔཁૉͷҐஔͰ͋Δɽͨͱ͑͹ɼΦϒδΣ࣮‫ݧ‬ର৅ͱ͢ΔϓϩάϥϜ͸ Defects4J ͔Βൈਮͨ͠Ϋτ A ͕ม਺Ϧετ V (l) ͷઌ಄͔Β 3 ൪໨ʹ͋Γ, ͦͷόάࣄྫ͓Αͼ Lifegame ͷάϥΠμʔύλʔϯͱ͢Δ.

ϑΟʔϧυ var ͕ A Λల։ͨ͠πϦʔͷઌ಄͔Β 5 ൪໨

Defects4J ͸όά͕ࠞೖͨ͠ίʔυͷϕϯνϚʔΫͰ͋Δ.

ʹ͋Δ৔߹, P (A.var, V (l)) = 3 + 5 = 8 Ͱ͋Δɽ3 ‫ݸ‬ͷόά͕ൃ‫͞ݟ‬Εͨ 4 ͭͷέʔεɼ1bɼ2bɼ3bɼ4b Λ De-ཁૉΛ࣋ͭ഑ྻ a ͕ม਺Ϧετ Vl ͷ 4 ൪໨ʹ͋Δ৔߹ɼ

fects4J ͔Βൈਮͨ͠ɽ͜ΕΒ͸ Apache Commons Lang

P (a[2], Vl ) = 4 + 3 = 7 Ͱ͋ΔɽΦϒδΣΫτ΍഑ྻ͕ೖϓϩδΣΫτͷόά͕ະम੔ͷঢ়ଶͷϓϩάϥϜͰ͋Γɼc 2016 Information Processing Society of Japan

6

Vol.2016-SE-192 No.2
Vol.2016-EMB-41 No.2
2016/6/2

৘ใॲཧֶձ‫ڀݚ‬ใࠂ
IPSJ SIG Technical Reportද 2࣮‫ݧ‬ର৅ϝιου

Table 2 Subject methods of the experimentϓϩάϥϜ IDΫϥε͓Αͼϝιου

Lang 1borg.apache.commons.lang3.math.NumberUtilsTest.testLang747

Lang 2borg.apache.commons.lang3.LocaleUtilsTest.testParseAllLocales

Lang 3borg.apache.commons.lang3.math.NumberUtilsTest.testStringCreateNumberEnsureNoPrecisionLoss

Lang 4borg.apache.commons.lang3.text.translate.LookupTranslatorTest.testLang882

Lifegame

lifegame.BoardModel.nextͦΕͧΕ 1 ͚ͭͩςετ࣮ߦ͕ࣦഊ͢Δϝιου͕༻ҙ͞Ҏ্ͷ݁Ռ͸ɼ࢖༻͍ͯ͠Δม਺͕ଟ͍ϝιουͰͷσΕ͓ͯΓɼͦΕΒͷϝιουͷ։͔࢝Βऴྃ·ͰΛ‫؍‬ଌରόοάʹ͓͍ͯɼఏҊख๏ʹΑΔม਺ͷฒ΂ସ͕͑ޮՌΛ৅ͱͨ͠ɽLifegame ͸ੜ໋ͷ஀ੜɼ౫ଡͳͲͷϓϩηε

ൃ‫͢ش‬Δ͜ͱΛ͍ࣔͯ͠Δɽ࢖༻͞ΕΔม਺ͷ਺͸ϝιοΛ؆қతϞσϧͰදͨ͠γϛϡϨʔγϣϯήʔϜͰ͋Γɼυ͝ͱʹ΋େ͖͘ҟͳΔͨΊɼσόοάʹ͓͚Δ༗ޮੑͷେࡕେֶ‫ֶ޻ૅج‬෦৘ใՊֶՊ 2 ೥ੜͷ Java ϓϩάϥϛ

ධՁ͸ɼࠓ‫ޙ‬ɼ͞Βʹద༻όάࣄྫ਺Λ֦େͯ͠ͷௐ͕ࠪϯάԋश‫ڭͯ͠ͱࡐڭ‬һ͕࡞੒࣮ͨ͠૷ʹ͓͍ͯɼ൫໘ͷ

ඞཁͰ͋Δɽ·ͨɼର৅ͱ͢Δϝιουͷ։͔࢝Βऴྃ·ঢ়ଶΛήʔϜͷϧʔϧʹैͬͯߋ৽͢ΔॲཧΛ࣮૷͍ͯ͠

Ͱͷશ໋ྩΛεςοϓ࣮ߦ͕ͨ͠ɼ࣮ࡍͷϓϩάϥϜ։ൃΔϝιουͷ։͔࢝Βऴྃ·ͰΛ‫؍‬ଌର৅ͱͨ͠ɽ͜ΕΒͰ͸όάͷ͍͕ٙ͋ΔҰ෦෼͚ͩΛεςοϓ࣮ߦ͢Δ͜ͱ

ϓϩάϥϜͷΫϥε໊ɼϝιου໊Λද 2 ʹࣔ͢ɽ΋ଟ͘ɼࠓճͷ࣮‫݁ݧ‬Ռ͕࣮ࡍͷϓϩάϥϜ։ൃʹ͓͚Δ

Defects4J Λର৅ʹબΜͩཧ༝͸࣮ࡍʹόάͷ͋Δঢ়‫گ‬ޮՌΛਖ਼֬ʹ൓ө͍ͯ͠Δͱ͸‫ݶ‬Βͳ͍ɽ͜ͷ఺͸ɼࠓ‫ޙ‬Ͱຊ‫Ͱڀݚ‬ఏҊ͢Δม਺Ϗϡʔ͕ͲΕ΄ͲͷޮՌ͕͋Δ͔ͷඃ‫Ͳͳݧ࣮ऀݧ‬Λ௨ͯ͡ɼ࣮ࡍͷσόοά࡞‫΁ۀ‬ͷӨ‫ڹ‬Λ͔֬ΊΔͨΊͰ͋Δɽ·ͨɼLifegame Λର৅ʹબΜͩཧΛ֬ೝ͢Δඞཁ͕͋Δɽ༝͸ɼηϧͷද‫ʹݱ‬ೋ࣍‫ݩ‬഑ྻΛ༻͍ΔͨΊɼࢀরՄೳͳ
஋͕ଟ͍ͱߟ͑ΒΕΔͨΊͰ͋Δɽຊ‫Ͱڀݚ‬ఏҊ͢Δม਺

5. ·ͱΊ

Ϗϡʔ͸ଟ਺ͷม਺ͷத͔ΒҰ෦ͷม਺Λબͼग़ͨ͢Ίɼຊ‫Ͱڀݚ‬͸ɼ։ൃऀ͕Ӿཡ͢Δඞཁͷ͋Δม਺Λ୳͠ग़ࢀরՄೳͳม਺͕ଟ͍΄ͲɼP (v, V ) ͷ࡟‫ظ͕ݮ‬଴Ͱ͖Δɽ͢࡞‫ʹۀ‬අ΍࣌ؒ͢ͱ࿑ྗΛ࡟‫͢ݮ‬ΔͨΊʹɼ࣍ͷ໋ྩΑͬͯ Lifegame ʹ͓͍ͯ΋ɼ࡟‫ޮݮ‬Ռ͕‫ظ‬଴Ͱ͖Δɽ

Ͱ࢖༻͞ΕΔม਺Λ஫໨͢΂͖ม਺ͱͯ͠ఏࣔ͢Δม਺

Defects4J ͷ֤ϓϩάϥϜͷ࣮ߦ݁Ռ͔Β‫؍‬ଌ͞ΕͨϏϡʔΛࢼ࡞ͨ͠ɽ࣮ࡍͷόάࣄྫΛूΊͨϕϯνϚʔΫP (v, VE (l)) ͷ෼෍Λ preɼP (v, V (l)) ͷ෼෍Λ post ͱ͠

Defects4J ʹऩ࿥͞Εͨ 4 ͭͷࣄྫͱɼत‫͞༻࢖Ͱۀ‬Εͯͯද‫ͨ͠ه‬ശͻ͛ਤΛਤ 3 ʹࣔ͢ɽྫ͑͹ɼ1b-pre ͸ 1b

͍Δ‫ࡐڭ‬ϓϩάϥϜ Lifegame ͷಈ࡞ͷ෼ੳʹରͯ͠ద༻

ʹख๏Λద༻͍ͯ͠ͳ͍৔߹ͷม਺ͷදࣔҐஔͷ෼෍ɼͨ݁͠Ռɼม਺͕ଟ਺࢖ΘΕΔϝιουதͰ͋ͬͯ΋ɼ࣍

3b-post ͸ 3b ʹख๏Λద༻ͨ͠৔߹ͷม਺ͷදࣔҐஔͷ෼ͷ໋ྩͰ࢖༻͞ΕΔগ਺ͷม਺ΛϏϡʔͷઌ಄ʹूΊΒΕ

෍Ͱ͋Δɽಉ༷ʹɼLifegame ͷϓϩάϥϜͷ࣮ߦ݁Ռ͔ΒΔ͜ͱΛ֬ೝͨ͠ɽม਺ͷҐஔͷฏ‫ۉ‬஋͕ɼDefects4J Ͱ‫؍‬ଌ͞Εͨ஋ͷ෼෍Λਤ 4 ʹࣔ͢ɽ͜ΕΒͷਤ͔Βɼ1bɼ

͸ 2.607 ͔Β 1.258 ʹ࡟‫͞ݮ‬ΕɼLifegame Ͱ͸ 3.915 ͔Β

2b ͷ৔߹Λআ͍ͯఏҊख๏Λద༻ͨ͠ํ͕தԝ஋͕খ͞

2.718 ʹ࡟‫͞ݮ‬Εͨɽ௨ৗɼม਺Ϗϡʔͷදࣔ໘ੵ͸Ұఆ͘ͳ͍ͬͯΔɽ·ͨɼ͍ͣΕͷ৔߹΋ఏҊख๏Λద༻ͨ͠

Ͱ͋Δͱߟ͑ΒΕΔͨΊɼࢀরՄೳͳม਺͕ଟ͍ϝιουํ͕ୈࡾ࢛෼఺΍࠷େ஋͕খ͘͞ͳΓɼશମతʹ෼෍͕ 1Ͱม਺ͷදࣔൣғ͕খ͘͞཈͑ΒΕΔޮՌ͸େ͖͍ͱߟ͑

ʹ͍͍ۙͮͯΔɽΒΕΔɽ

1bɼ2b ͸֤ߦͰࢀরՄೳͳม਺͕গͳ͘ɼͦͷͨΊશମࠓ‫ޙ‬ͷ՝୊ͱͯ͠͸ɼ·ͣɼ෭࡞༻Λ࣋ͨͳ͍ϝιου‫ݺ‬తʹ P (v, V ) ͷ࡟‫͕ྔݮ‬খ͘͞ɼதԝ஋͕มΘΒͳ͔ͬͨͼग़͠ઌͷ࣮ߦ಺༰ͷ൓өͳͲͷόΠτίʔυղੳ‫ػ‬ೳͷͱߟ͑ΒΕΔɽҰํɼ3b ʹ͓͍ͯ͸ୈࡾ࢛෼఺΍࠷େ஋͕֦େ͕‫͛ڍ‬ΒΕΔɽ·ͨɼຊ‫Ͱڀݚ‬͸ར༻ऀͷෛՙܰ‫ݮ‬Λେ͖͘‫ݮ‬গ͓ͯ͠ΓɼLifegame ʹ͓͍ͯ͸֎Ε஋ͷ‫͕਺ݸ‬ม਺ͷ஋ͷදࣔҐஔʹΑͬͯධՁ͍ͯ͠Δ͕ɼม਺Ϗϡʔେ͖͘‫ݮ‬গ͍ͯ͠Δɽ3b ΍ Lifegame ͸֤ߦͰࢀরՄೳͳ

ͷ࣮ࡍͷར༻ʹ༩͑ΔӨ‫ڹ‬Λඃ‫ʹݧ࣮ऀݧ‬ΑͬͯධՁ͢Δ

ม਺͕ଟ͍ύλʔϯͰɼશମతʹ P (v, V ) ͷ࡟‫͕ྔݮ‬େ͖͜ͱ΋ࠓ‫ޙ‬ͷ՝୊Ͱ͋Δɽ

͔ͬͨͱߟ͑ΒΕΔɽ͜ͷਤ͔ΒɼఏҊख๏Λద༻͢Δ͜ँࣙຊ‫ڀݚ‬͸ JSPS Պ‫ݚ‬අ 26280021 ͷॿ੒Λड͚ͨͱͰɼࢀরՄೳͳม਺͕ଟ͍ϝιουͰ͸ม਺Ϗϡʔͷม΋ͷͰ͢ɽ਺ͷҐஔΛද͢਺஋ P (v, V ) ͕େ͖͘࡟‫͞ݮ‬ΕΔҰํɼࢀরՄೳͳม਺͕গͳ͍ϝιουͰ͸͋·Γ P (v, V ) ͸࡟‫ݮ‬͞Εͳ͍͜ͱ͕Θ͔Δɽ

c 2016 Information Processing Society of Japan

7

Vol.2016-SE-192 No.2
Vol.2016-EMB-41 No.2
2016/6/2

৘ใॲཧֶձ‫ڀݚ‬ใࠂ

2

4

6

8

10

12

IPSJ SIG Technical Report

1b−preਤ 31b−post2b−pre2b−post3b−pre3b−post4b−pre4b−postDefects4J ͷ࣮ߦͰ‫؍‬ଌ͞Εͨม਺ͷදࣔҐஔͷ෼෍ɽ“Pre” ͓Αͼ “Post” ͸ͦΕͧΕఏҊख๏ద༻લɼ‫ޙ‬ͷ஋Λҙຯ͢Δɽ

Fig. 3 Distributions of variable positions observed in executions of Defects4J. “Pre”
and “post” indicate the results obtained without/with our method.

[4]
[5]

15

20

[6]

10

[7]

5

[8]

[9]
Lifegame−Pre

Lifegame−Post

[10]
ਤ 4

Lifegame ͷ࣮ߦͰ‫؍‬ଌ͞Εͨม਺ͷදࣔҐஔͷ෼෍ɽ“pre”
͓Αͼ “post” ͸ͦΕͧΕఏҊख๏ద༻લɼ‫ޙ‬ͷ஋Λҙຯ͢Δɽ

Fig. 4 Distributions of variable positions observed in executions of Lifegame. “Pre” and “post” indicate the results

Project, E.: The Eclipse Foundation open source community website., https://eclipse.org/.
Alsallakh, B., Bodesinsky, P., Gruber, A. and Miksch,
S.: Visual Tracing for the Eclipse Java Debugger, CSMR
2012, pp. 545–548 (2012).
Lewis, B.: Debugging Backwards in Time, Proceedigns of International Workshop on Automated Debugging,(online),availablefromhttp://arxiv.org/html/cs/0309027v4 (2003).
Ko, A. J. and Myers, B. A.: Designing the Whyline: A
Debugging Interface for Asking Questions About Program Behavior, Proceedings of the SIGCHI Conferenceon Human Factors in Computing Systems, pp. 151–158(online), DOI: 10.1145/985692.985712 (2004).
Ressia, J., Bergel, A. and Nierstrasz, O.: Object-centric
Debugging, Proceedings of the 34th International Conference on Software Engineering, pp. 485–495 (2012).
Abramson, D., Chu, C., Kurniawan, D. and Searle, A.:
Relative debugging in an integrated development environment, Software Practice and Experience, Vol. 39,
No. 14, pp. 1157–1183 (2009).
Ernst, M. D., Perkins, J. H., Guo, P. J., McCamant, S.,
Pacheco, C., Tschantz, M. S. and Xiao, C.: The Daikon
System for Dynamic Detection of Likely Invariants, Sci.
Comput. Program., Vol. 69, No. 1-3, pp. 35–45 (online),
DOI: 10.1016/j.scico.2007.01.015 (2007).

obtained without/with our method.

ࢀߟจ‫ݙ‬
[1]

[2]
[3]

Cambridge News:
Experts battle ˊ 192bn loss
to computer bugsɼhttp://www.cambridge-news.
co.uk/Experts-battle192bn-loss-bugs/
story-22514741-detail/story.html.
Zeller, A.: σόοάͷཧ࿦ͱ࣮ફ–ͳͥϓϩάϥϜ͸͏·͘ಈ͔ͳ͍ͷ͔ɼO’Reilly Japan, 2nd edition (2012).
Rosenberg, J. B.: σόοΨͷཧ࿦ͱ࣮૷ɼΞεΩʔग़൛‫( ہ‬1998).

c 2016 Information Processing Society of Japan

8