ソフトウェアエンジニアリングシンポジウム 2013

Thin Slice ͷαΠζʹؔ͢Δ౷‫ܭ‬తධՁਇ໺ ஐਉ1

ࣛౡ ༔1

ੴඌ ོ1

Ҫ্ ࠀ࿠1֓ཁɿϓϩάϥϜཧղͷ࣌ؒΛ‫ݮ‬Βͨ͢Ίͷٕज़ͱͯ͠ɼϓϩάϥϜεϥΠγϯά͕ఏҊ͞Ε͍ͯΔɽϓϩάϥϜεϥΠγϯά͸ɼϓϩάϥϜ಺ͷ͋ΔจΛ‫ج‬४ͱͯ͠ɼͦͷจʹӨ‫ڹ‬Λ༩͑ΔՄೳੑͷ͋Δ͢΂ͯͷจΛϓϩάϥϜεϥΠεͱͯ͠நग़͢Δٕज़Ͱ͋Δɽ͔͠͠ɼେ‫ن‬໛ϓϩάϥϜͷ৔߹͸ɼϓϩάϥϜεϥΠεࣗମ͕ඇৗʹେ͖͘ͳͬͯ͠·͍ɼϓϩάϥϜཧղ΁ͷར༻͸೉͍͠ɽThin Slicing ͸ɼ։ൃऀͷબΜͩจ͕࢖༻͢ΔσʔλΛੜ੒ͨ͠จͷΈΛநग़͢Δ͜ͱͰɼϓϩάϥϜεϥΠεͷαΠζΛ‫ݮ‬Βٕ͢ज़Ͱ͋Δɽ͔͠͠ɼҰൠʹ Thin Slicing ͕ɼͲͷఔ౓ͷେ͖͞ͷϓϩάϥϜεϥΠεΛநग़͢Δͷ͔͸ࣔ͞Ε͍ͯͳ͍ɽຊ‫Ͱڀݚ‬͸ɼ7 ‫ݸ‬ͷ Java ϓϩάϥϜͷ͢΂ͯͷσʔλϑϩʔΛର৅ʹ Thin Slice Λ‫͠ࢉܭ‬ɼͦͷαΠζʹؔ͢Δ౷‫ܭ‬తධՁΛߦͬͨɽͦͷ݁ՌɼThin Slice ͷαΠζ͸ฏ‫Ͱۉ‬ϓϩάϥϜͷ

2.2%Ͱ͋Γɼ60 ͔Β 80%ͷεϥΠεͰ͸ 0.1%ҎԼͱे෼খ͘͞ͳΔ͜ͱΛ֬ೝͨ͠ɽ

A Statistical Evaluation of Thin Slice Size
TOMOMI HATANO1YU KASHIMA1

TAKASHI ISHIO1

KATSURO INOUE1

Abstract: Program slicing is a technique which supports program comprehension. Program slicing extracts
all statements — called a program slice — that may aﬀect a certain statement. However, program slicing is
not useful if an analysis target program is too large since program slices of such a program are also often toolarge. Thin slicing is a technique reducing the size of program slice by extracting only statements producing
data which is used by a selected statement. However, the size of Thin Slice in general has not been revealed.
In this paper, we computed Thin Slices for every data-ﬂow path in 7 Java programs, and then performed
statistical evaluation. As a result, the average size of Thin Slice is 2.2% of a program. Furthermore, 60 to
80% of Thin Slices are 0.1% or less.

1. ·͕͖͑

ϯά͸ɼϓϩάϥϜ಺ͷ͋ΔจΛ‫ج‬४ͱͯ͠ɼͦͷจʹӨ‫ڹ‬Λ༩͑ΔՄೳੑͷ͋Δ͢΂ͯͷจΛϓϩάϥϜεϥΠε

։ൃऀ͸ϓϩάϥϜͷอक࡞‫ʹۀ‬ଟ͘ͷ࣌ؒΛඅ΍ͯ͠ʢҎԼɼ୯ʹεϥΠεͱ͍͏ʣͱͯ͠நग़͢Δٕज़Ͱ͋Δɽ͓Γɼอक࡞‫ۀ‬ͷதͰ΋ɼଟ͘ͷ࣌ؒΛϓϩάϥϜཧղʹϓϩάϥϜεϥΠγϯάʹΑͬͯɼ։ൃऀ͕ϓϩάϥϜཧඅ΍͍ͯ͠Δ [1], [2]ɽ͞ΒʹɼϓϩάϥϜཧղΛߦ͏ͨΊղͷͨΊʹಡΉίʔυ͕গͳ͘ͳΓɼཧղʹ͔͔Δ࣌ؒΛʹ͸੩తͳσʔλґଘؔ܎΍ϝιουͷ‫ͼݺ‬ग़ؔ͠܎Λௐ‫ݮ‬Β͢͜ͱ͕Ͱ͖Δɽ͔͠͠ɼεϥΠεͷαΠζͷฏ‫ۉ‬஋ࠪ͢Δ࡞‫͕ۀ‬ඞཁͰ͋Γɼ։ൃऀ͸ɼ͜ͷ࡞‫ؒ࣌ʹۀ‬Λ͔͸ɼϓϩάϥϜશମͷ໿ 30%Ͱ͋Γ [6]ɼେ‫ن‬໛ϓϩάϥ

͚͍ͯΔ͜ͱ͕ࢦఠ͞Ε͍ͯΔ [3], [4]ɽϜͷอक࡞‫͚͓ʹۀ‬ΔϓϩάϥϜཧղͷࡍʹɼϓϩάϥϜ

ϓϩάϥϜཧղͷ࡞‫ؒ࣌ۀ‬Λ‫ݮ‬Βͨ͢Ίͷٕज़ͱͯ͠ɼ
ϓϩάϥϜεϥΠγϯά͕͋Δ [5]ɽϓϩάϥϜεϥΠγ
1εϥΠγϯάΛར༻͢Δ͜ͱ͸ࠔ೉Ͱ͋Δɽ
εϥΠεͷαΠζΛ‫ݮ‬Β͢ख๏ͱͯ͠ɼThin Slicing ͕ఏҊ͞Ε͍ͯΔ [7]ɽ Thin Slicing ͸ɼ‫ج‬४ͱͳΔจ͕࢖

େࡕେֶେֶӃ৘ใՊֶ‫ڀݚ‬ՊGraduate School of Information Science and Technology, Osaka University©2013 Information Processing Society of Japan༻͢ΔσʔλΛੜ੒ͨ͠จͷΈΛநग़͢ΔεϥΠγϯάख1

ソフトウェアエンジニアリングシンポジウム 2013

๏Ͱ͋ΔɽຊߘͰ͸ɼThin Slicing ʹΑΓநग़͞Εͨจͷͷ௖఺͔Β s2 ͷ௖఺ʹσʔλґଘลΛҾ͘ɽ͜ͱΛ Thin Slice ͱ‫͕Ϳݺ‬ɼThin Slice ͸௨ৗͷϓϩάϥ

( 1 ) s1 ͕ม਺ x ͷ஋Λఆٛ͢Δɽ

ϜεϥΠεʹൺ΂αΠζ͕ඇৗʹখ͘͞ɼϓϩάϥϜཧղ( 2 ) s2 ͕ม਺ x ͷ஋Λ࢖༻͢Δɽ

ʹඞཁͳ࡞‫ۀ‬ͷதͰ΋ɼෳ਺ͷϝιουΛ‫ܦ‬༝͢Δσʔλ( 3 ) s1 ͔Β s2 ʹɼx ͷ஋Λॻ͖‫ܦߦ࣮͍ͳ͑׵‬࿏͕ͷґଘؔ܎Λௐࠪ͢Δ࣌ؒΛ‫ݮ‬Β͢ޮՌ͕‫ظ‬଴Ͱ͖Δɽ[7]Ͱ͸ɼThin Slicing ʹΑΓϓϩάϥϜཧղͷ͕࣌ؒ‫ݮ‬গ͠
ͨྫ͕ 22 ‫঺ݸ‬հ͞Ε͍ͯΔɽ

গͳ͘ͱ΋ 1 ͭଘࡏ͢Δɽ੍‫ޚ‬ґଘؔ܎

จ s1 ੍͕‫ޚ‬จͰ͋Γɼs1 ͷ݁ՌʹΑͬͯs2 ͕࣮ߦ͞ΕΔ͔Ͳ͏͔͕ܾఆ͞ΕΔ৔߹ɼs2 ͸ s1

Thin Slicing ͸༗๬ͳख๏Ͱ͋Δ͕ɼҰൠతͳঢ়‫͓ʹگ‬ʹ੍‫ޚ‬ґଘ͢Δͱ͍͍ɼs1 ͷ௖఺͔Β s2 ͷ௖఺ʹ੍͍ͯৗʹ༗ޮͰ͋Δ͔Ͳ͏͔͸໌Β͔Ͱ͸ͳ͍ɽैདྷͷ‫ޚ‬ґଘลΛҾ͘ɽ·ͨɼखଓ͖ͷೖ‫ޱ‬Λද͢ΤϯτϦεϥΠγϯάख๏ʹ͍ͭͯ͸ɼBinkley ΒʹΑͬͯεϥΠ௖఺ͱ͍͏ಛผͳ௖఺Λઃ͚ɼखଓ͖಺Ͱଞͷจ͔ΒεαΠζͷฏ‫ۉ‬஋͕‫͞ࢉܭ‬Ε͍ͯΔ [6]ɽ·ͨɼJász Β [8]ͷ੍‫ޚ‬ґଘลΛ࣋ͨͳ͍จʹରͯ͠ɼΤϯτϦ௖఺͔͸ɼϝιου‫ͼݺ‬ग़͠ͱ੍‫ޚ‬ґଘؔ܎ͷΈΛ༻͍ͨεϥΠΒ੍‫ޚ‬ґଘลΛҾ͘ɽεͷߴ଎ͳۙࣅ‫ࢉܭ‬ΛఏҊ͓ͯ͠Γɼͦͷ‫݁ࢉܭ‬Ռͷฏ‫ۉ‬

SDG ͸ɼ֤ PDG Λखଓ͖ؒͷؔ܎Ͱ઀ଓͨ͠άϥϑͰ஋͸εϥΠεαΠζͷฏ‫ۉ‬஋ΑΓ 4.27%େ͖͘ͳΔ͜ͱΛ͋Δɽखଓ͖ؒͷؔ܎͸ɼ࣮ύϥϝʔλ͔ΒԾύϥϝʔλ͍ࣔͯ͠ΔɽBinkley Β΍ Jász Βͷ‫ڀݚ‬ͷΑ͏ʹɼThin΁ͷσʔλґଘลɼฦΓ஋͔Β‫ͼݺ‬ग़͠‫΁ݩ‬ͷσʔλґଘSlicing ʹ͓͍ͯ΋ Thin Slice ͷαΠζͷฏ‫ۉ‬஋Λ‫͠ࢉܭ‬ɼลͱखଓ͖‫ͼݺ‬ग़͠จ͔ΒΤϯτϦ௖఺΁ͷ੍‫ޚ‬ґଘลͰͦͷ༗ޮੑΛධՁ͢Δඞཁ͕͋Δɽද͞ΕΔɽຊ‫Ͱڀݚ‬͸ɼJava ‫هͰޠݴ‬ड़͞ΕͨϓϩάϥϜΛର৅ͱεϥΠε͸ɼεϥΠεΛ‫͢ࢉܭ‬ΔͨΊͷ‫ͳͱ఺ج‬Δจͱ

ͨ͠ Thin Slicing Λ࣮૷͠ɼThin Slice ͷαΠζʹؔ͢Δ

ม਺ΛఆΊʢ͜ΕΛεϥΠγϯά‫ج‬४ͱ͍͏ʣɼͦͷ‫఺ج‬౷‫ܭ‬తධՁΛߦ͏ɽ[7] Ͱ͸ɼ22 ‫ݸ‬ͷྫͰ༗ޮͰ͋Δ͜ͱ͕

ʹ૬౰͢Δ SDG ্ͷ௖఺͔ΒґଘลʹԊͬͨ୳ࡧΛߦ͍ɼ֬ೝ͞Ε͍ͯΔ͚ͩͳͷʹର͠ɼຊ‫Ͱڀݚ‬͸ Thin Slice ͷ‫ͨͬͳͱ఺ج‬௖఺ࣗ਎Λ‫ؚ‬Ή౸ୡൣғͷ௖఺ू߹ͱͯ͠‫ܭ‬αΠζͷฏ‫ۉ‬஋Λ‫͠ࢉܭ‬ɼଟ͘ͷ৔߹Ͱ༗ޮͰ͋Δ͔Ͳ͏ࢉ͞ΕΔɽεϥΠεͷ‫ํࢉܭ‬๏͸ɼґଘลΛ‫Ͳͨʹ޲ํٯ‬͔Λ֬ೝ͢ΔɽεϥΠεαΠζ͕े෼ʹখ͚͞Ε͹ɼ։ൃΔ‫ޙ‬Ζ޲͖εϥΠγϯάͱॱํ޲ʹͨͲΔલ޲͖εϥΠγऀ͕Ӿཡ͠ͳ͚Ε͹ͳΒͳ͍จ͕গͳ͘ͳΔɽ·ͨɼσʔϯάʹ෼͚ΒΕΔɽ

λͷੜ੒‫ݩ‬΍࢖༻ઌΛ Thin Slicing ʹΑͬͯಛఆͰ͖Ε

Binkley Β [6] ͸ɼ߹‫ ܭ‬136,000 ߦʹ‫ Ϳٴ‬43 ͷϓϩάϥ

͹ɼ։ൃऀ͕σʔλґଘؔ܎Λௐࠪ͢Δ࡞‫[ ۀ‬3], [4] ͷ࣌ؒϜʹ͍ͭͯɼ͢΂ͯͷจʹରͯ͠લ޲͖εϥΠεͱ‫ޙ‬Ζ޲͕࡟‫͖Ͱݮ‬Δɽ͔͠͠ɼϝιου‫ͼݺ‬ग़͠ΛͨͲΒͳ͘ͱ͖εϥΠεΛ‫ݧ࣮ͨ͠ࢉܭ‬Λߦ͍ͬͯΔɽ͜ͷ࣮‫Ͱݧ‬͸ɼ΋σʔλΛੜ੒͍ͯ͠Δจ͕༰қʹ‫͔ͭݟ‬Δ৔߹͸ɼThinεϥΠεʹ‫·ؚ‬ΕΔจ͸ɼฏ‫Ͱۉ‬ϓϩάϥϜ಺ͷ͢΂ͯͷ

Slicing ͷޮՌ͸௿͍ͱߟ͑ΒΕΔɽͦͷͨΊຊ‫ڀݚ‬ͷ࣮‫ݧ‬จͷ໿ 30% Ͱ͋Δ͜ͱ͕ड़΂ΒΕ͍ͯΔɽ਺ඦສߦΛ௒Ͱ͸ɼϓϩάϥϜதͷશσʔλϑϩʔ͔Β Thin Slicing ͷ͑Δେ‫ن‬໛ϓϩάϥϜͰ͸ɼϓϩάϥϜεϥΠγϯάΛརޮՌ͕‫ظ‬଴Ͱ͖Δσʔλϑϩʔͷׂ߹Λௐࠪ͢ΔͨΊʹɼ༻ͯ͠΋ௐࠪର৅ͱͳΔεϥΠεͷαΠζ͕େ͖͘ͳΓɼεϥΠεαΠζʹՃ͑ɼεϥΠε͕·͕ͨΔϝιου਺΍ɼ։ൃऀ͕εϥΠεʹ‫·ؚ‬ΕΔ͢΂ͯͷจΛӾཡ͢Δ͜ͱ͸࢖༻͍ͯ͠Δσʔλͷੜ੒‫͍ͯͬͳͱݩ‬Δจͷ਺ͱ͍ͬͨࠔ೉Ͱ͋Δɽ

ࢦඪΛ‫ܭ‬ଌͨ͠ɽ

2.2 Thin Slicing

2. എ‫ܠ‬Thin Slicing[7] ͸ɼॏཁͳσʔλґଘؔ܎ͷΈΛऔΓѻ

2.1 ϓϩάϥϜεϥΠγϯά

͏͜ͱͰεϥΠεαΠζΛ‫ݮ‬Β͠ɼϓϩάϥϜཧղ΍σϓϩάϥϜεϥΠγϯά͸ɼϓϩάϥϜ಺ͷ͋ΔจʹӨόοά࡞‫͚͓ʹۀ‬Δ։ൃऀͷෛ୲Λܰ‫͢ݮ‬ΔεϥΠγϯά

‫ڹ‬Λ༩͑ΔՄೳੑͷ͋Δ͢΂ͯͷจΛநग़͢Δٕज़Ͱ͋

ख๏Ͱ͋ΔɽThin Slicing ʹ͸ɼContext-Insensitive Thin

Δ [5]ɽεϥΠεͷ‫ʹࢉܭ‬͸ɼϓϩάϥϜґଘάϥϑʢPro-

Slicing ͱ Context-Sensitive Thin Slicing ͷ 2 छྨͷ‫ํࢉܭ‬gram Dependence GraphɼҎԼ PDGʣΛ֦ுͨ͠γες

๏͕͋Δ͕ɼຊ‫Ͱڀݚ‬͸ Context-Insensitive Thin SlicingϜґଘάϥϑ [9]ʢSystem Dependence GraphɼҎԼ SDGʣͷΈΛѻ͏ɽ͜Ε͸ɼ[7] ʹ͓͍ͯɼContext-Sensitive ThinΛ༻͍ΔɽPDG ͸ɼϓϩάϥϜ಺ͷ 1 ͭͷखଓ͖ͷ֤จ

Slicing ͷ‫͕ؒ࣌ࢉܭ‬๲େͰ͋Γɼ࣮༻తͳϓϩάϥϜͰ༻Λ௖఺ͱ͠ɼͦΕΒͷ௖఺ؒͷґଘؔ܎Λ༗޲ลͰදͨ͠

͍Δ͜ͱ͕‫࣮ݱ‬తͰ͸ͳ͍͜ͱ͕ࣔ͞Ε͍ͯΔͨΊͰ͋Δɽ

άϥϑͰ͋Δɽґଘؔ܎͸σʔλґଘؔ܎ͱ੍‫ޚ‬ґଘؔ܎εϥΠγϯά‫ج‬४ s ʹର͢Δ Thin Slice ͱ͸ɼs ͕σʔ͕͋ΓɼͦΕͧΕ࣍ͷΑ͏ʹఆٛ͞ΕΔɽ

λґଘ͢Δจͷू߹Ͱ͋Δɽͨͩ͠ɼThin Slicing Ͱ͸Ҏσʔλґଘؔ܎

ԼͷΑ͏ʹσʔλґଘؔ܎Λఆٛ͢Δɽจ s1 ͱ s2 ͷؒʹҎԼͷ৚͕݅͢΂ͯ੒Γཱͬͨͱ͖ɼs2 ͸ s1 ʹσʔλґଘ͢Δͱ͍͍ɼs1©2013 Information Processing Society of Japanखଓ͖಺ͷσʔλґଘؔ܎͸ϓϩάϥϜεϥΠγϯάͱ2

ソフトウェアエンジニアリングシンポジウム 2013

1 package sample;
2 public class Main {3 public static void main(String[] args) {4
A a = new A();5
int id;6
if (args.length > 0)7
id = 1;8else
9id = 0;10 a.addData(id);11 System.out.println(a);
12 }
13 }
14 class A {15 B b = new B();
16 void addData(int id) {17b.addData(id);
18 }
19 }

ਤ 1

20 class B {21 int max = 4;
22 X x = new X();
23 void addData(int id) {24
if (id >= 0 && id <= max)
25
x.addData(id);
26 }
27 }
28 class X {29 int[] idList = new int[16];30 int count = 0;
31 void addData(int id) {32
System.out.println(id);33
idList[count] = id;34
count = count + 1;
35 }36 int getData(int index) {37
return idList[index];
38 }
39 }

Thin Slicing ͷྫFig. 1 Examples of Thin Slicing

3. ௐࠪ໨త
ຊ‫Ͱڀݚ‬͸ɼThin Slicing ͕ଟ͘ͷঢ়‫Ͱگ‬༗ޮʹಇ͔͘Ͳ͏͔ΛධՁ͢ΔͨΊʹɼThin Slice ͷαΠζʹؔ͢Δ౷
‫ܭ‬తධՁΛߦ͏ɽ۩ମతͳϦαʔνΫΤενϣϯ͸ɼҎԼ
ͷ 2 ͭͰ͋Δɽ

RQ1 Thin Slice ͷαΠζ͸ɼฏ‫ۉ‬తʹे෼খ͍͞΋ͷͰ͋Δ͔ɽ

RQ2 σʔλґଘؔ܎ͷௐࠪʹ͓͍ͯ༗ޮͰ͋Δͱߟ͑ΒΕΔ Thin Slice ͸Ͳͷఔ౓ଘࡏ͢Δ͔ɽ

4. Thin Slicing ͷ࣮૷ຊ‫Ͱڀݚ‬͸ɼ࣮‫ݧ‬Λߦ͏ͨΊʹ Java ϓϩάϥϜͷόΠτ
ίʔυʢද 1ʣΛର৅ͱͨ͠ Thin Slicing Λ࣮૷ͨ͠ɽຊ
࣮૷Ͱ͸ɼόΠτίʔυͷ 1 ໋ྩΛ௖఺ͱ͠ɼ໋֤ྩؒͷಉ༷ʹఆٛ͢Δɽͨͩ͠ɼϙΠϯλม਺Λհͯ͠ώʔϓྖσʔλґଘؔ܎Λลͱͨ͠άϥϑΛ࡞੒͢ΔɽҎ߱Ͱ͸ɼҬʹΞΫηε͍ͯ͠Δจʹ͍ͭͯ͸ɼώʔϓྖҬʹ͍ͭͯόΠτίʔυ্ͷσʔλґଘؔ܎ʹ͍ͭͯઆ໌͢ΔɽͷΈσʔλґଘؔ܎Λߟ͑Δɽͨͱ͑͹ p.f ͱ͍͏ϑΟʔϧυΛࢀর͢Δจ͸ɼf ʹؔ͢Δσʔλґଘؔ܎ͷΈΛߟ͑ɼp ʹؔ͢Δσʔλґଘؔ܎͸ߟ͑ͳ͍ɽ

4.1 ϩʔΧϧม਺ͱΦϖϥϯυɾελοΫؒͷσʔλґଘؔ܎खଓ͖ؒͷσʔλґଘؔ܎͸खଓ͖ͷ࣮Ҿ਺ʹ‫ͼݺ‬ग़͠

Java Ծ૝Ϛγϯ͸ɼΦϖϥϯυɾελοΫͱ‫ݺ‬͹ΕΔεઌͷԾҾ਺͕σʔλґଘ͢Δͱఆٛ͢Δɽ·ͨɼ‫ͼݺ‬ग़͠λοΫʹɼԋࢉͰ࢖༻͢Δ஋΍ͦͷ݁ՌΛอ͍࣋ͯ͠ΔɽઌͷฦΓ஋ʹ‫ͼݺ‬ग़͠‫͕ݩ‬σʔλґଘ͢Δͱఆٛ͢ΔɽͦͷͨΊɼϩʔΧϧม਺ͱΦϖϥϯυɾελοΫؒͰ஋ΛώʔϓྖҬͷσʔλґଘؔ܎͸ɼಉҰͷϑΟʔϧυ·ͨҠಈͤ͞Δ໋ྩ͕ଘࡏ͠ɼΦϖϥϯυɾελοΫ্ͷԋࢉ͸഑ྻͷ಺༰Λ୅ೖ͠ࢀর͢ΔՄೳੑͷ͋Δจͷ૊ʹ͍ͭʹ͓͚Δσʔλґଘؔ܎͚ͩͰͳ͘ɼϩʔΧϧม਺ͱΦϖͯɼॴଐ͢Δखଓ͖ʹؔ܎ͳ͘ɼࢀর͢Δจ͕୅ೖ͢ΔจϥϯυɾελοΫؒͷσʔλґଘؔ܎͕ଘࡏ͢Δɽʹσʔλґଘ͍ͯ͠Δͱఆٛ͢Δɽ

Thin Slice ͸ɼ্‫ه‬ͷఆٛʹରԠ͢ΔσʔλґଘลΛ

4.2 ϑΟʔϧυม਺ͱ഑ྻม਺ͷσʔλґଘؔ܎༗޲ลͱ͢ΔάϥϑͰ୳ࡧΛߦ͍‫͢ࢉܭ‬Δɽਤ 1 ʹ ThinϑΟʔϧυม਺ͷґଘؔ܎͸࣍ͷ 2 ͭͷํ๏Ͱܾఆ͢

Slicing ͷྫΛ 2 ͭࣔ͢ɽ1 ͭ໨͸ɼ32 ߦ໨ͷม਺ id ʹର

Δɽ1 ͭ໨͸ɼϑΟʔϧυม਺ʹ஋Λॻ͖ࠐΉ໋ྩͰ͋Δ

͢Δ Thin Slicing Ͱ͋Δɽ͜ͷม਺ id ͷ஋͸ 25 ߦ໨ͷϝ

PUTSTATIC ͱϑΟʔϧυม਺ͷ஋ΛಡΈࠐΉ໋ྩͰ͋Διου‫ͼݺ‬ग़͠จ͔Β౸ୡ͠ɼ25 ߦ໨Ͱ͸ม਺ x ͱ id Λ

GETSTATIC ͕ɼಉ͡Ϋϥεͷಉ͡ϑΟʔϧυ໊ʹର͠࢖༻͍ͯ͠ΔɽThin Slicing ͸ม਺ x ͷґଘؔ܎͸ߟ͑ͣɼͯߦΘΕ͍ͯΔ৔߹ʹ PUTSTATIC ͔Β GETSTATIC ʹม਺ id ͷґଘؔ܎ͷΈΛ୳ࡧ͢ΔͷͰɼ17 ߦ໨ͱ 10 ߦґଘลΛҾ͘ɽ2 ͭ໨͸ɼPUTFIELD ͱ GETFIELD ͕ɼ໨ͷϝιου‫ͼݺ‬ग़͠จͱ 7 ߦ໨ͱ 9 ߦ໨ͷ୅ೖจʹ౸ୡΤΠϦΞε͞Ε͍ͯΔՄೳੑͷ͋Δม਺ͷಉ͡ϑΟʔϧυ͢Δɽ݁Ռͱͯ͠ɼ32 ߦ໨ͷม਺ id ʹର͢Δ Thin Slice໊ʹରͯ͠ߦΘΕ͍ͯΔ৔߹ʹɼPUTFIELD ͔Β GET-

͸ɼ{7, 9, 10, 17, 25, 32} ߦ໨ͱͳΓɼ7 ߦ໨͔ 9 ߦ໨Ͱ

FIELD ʹґଘลΛҾ͘ɽΤΠϦΞεղੳʹ͸ɼAndersenੜ੒͞Εͨ஋͕౸ୡ͍ͯ͠Δ͜ͱ͕໌Β͔ʹͳΔɽ͜ͷྫͷϙΠϯλղੳ [10] ʹ‫ ͍ͨͮج‬Object-sensitive PointerͰ͸ɼThin Slice ͕ 4 ͭͷΫϥεͷ 4 ͭͷϝιουʹ·ͨ

Analysis[11] Λ༻͍ͨɽ഑ྻม਺͸ϑΟʔϧυม਺ͱಉ༷͕͍ͬͯΔͷͰɼ։ൃऀ͕ϝιουͷ‫ͼݺ‬ग़͠‫ݩ‬ΛͨͲͬʹɼΤΠϦΞε͞Ε͍ͯΔՄೳੑͷ͋Δ഑ྻʹ஋Λॻ͖ࠐͯσʔλґଘؔ܎Λ௥੻͢Δ࡞‫ʹۀ‬༗ޮͰ͋Δͱߟ͑ΒΕΉ໋ྩ͔ΒಡΈࠐΉ໋ྩʹґଘลΛҾ͘ɽ

Δɽ2 ͭ໨ͷྫ͸ɼ11 ߦ໨ͷม਺ a ʹର͢Δ Thin Slicing
Ͱ͋Δɽ͜ͷྫͰ͸ɼThin Slice ͕ 1 ͭͷϝιου಺Ͱ‫׬‬

4.3 ϝιουؒͷσʔλґଘؔ܎͓݁ͯ͠ΓɼιʔείʔυΛ‫ݟ‬Ε͹ 4 ߦ໨Ͱੜ੒͞Εͨ஋͋Δϝιου‫ͼݺ‬ग़͠จ͔Βɼͦͷ‫ͼݺ‬ग़͠จͰ‫ͼݺ‬ग़͕౸ୡ͍ͯ͠Δ͜ͱ͕͙͢ʹ෼͔ΔͨΊɼThin Slicing ͸͞ΕΔՄೳੑͷ͋Δ͢΂ͯͷϝιουʹରͯ͠ɼ࣮ύϥ༗ޮͰͳ͍ͱߟ͑ΒΕΔɽҰൠͷϓϩάϥϜʹ͓͍ͯɼͲ

ϝʔλ͔ΒԾύϥϝʔλ΁ͷґଘลͱฦΓ஋͔Β‫ͼݺ‬ग़ͪΒͷέʔεʹ֘౰͢ΔεϥΠγϯά‫ج‬४͕ଟ͍ͷ͔͸ [7]͠‫΁ݩ‬ͷґଘลΛҾ͘ɽϝιουͷಈతଋറͷղܾʹ͸ɼͰ͸໌Β͔ʹ͞Ε͍ͯͳ͍ɽ

Variable-Type Analysis[12] Λ༻͍ͨɽ©2013 Information Processing Society of Japan3

ソフトウェアエンジニアリングシンポジウム 2013

ද 1όΠτίʔυ໋ྩͷҰཡͱ෼ྨ

Table 1 Bytecode instructions໋ྩͷछྨϩʔΧϧม਺ͷಡΈࠐΈϩʔΧϧม਺ͷॻ͖ࠐΈϑΟʔϧυม਺ͷಡΈࠐΈϑΟʔϧυม਺ͷॻ͖ࠐΈ഑ྻม਺ͷಡΈࠐΈ഑ྻม਺ͷॻ͖ࠐΈΦϖϥϯυɾελοΫ؅ཧΦϒδΣΫτͷੜ੒෼ྨtransfertransfertransfertransfertransfertransferͳ͠sourcesource͔ͭ sink஋Λੜ੒͢Δԋࢉsource
ఆ਺ͷੜ੒

sink
ൺֱԋࢉ

ϝιουͷ‫ͼݺ‬ग़͠ϝιου͔Βͷ໭Γಛघtransfer

ILOAD
LLOAD
ISTORE
LSOTREGETFIELDPUTFIELDIALOADLALOAD
IASTORELASTORE
POP
POP2
NEW
NEWARRAY
IADD
LADD
LMUL
FMUL
FREM
DREM
LSHR
IUSHR
IINC
I2L
F2D
D2I
FCMPG
DCMPL
ICONST M1
ICONST 3
LCONST 1
DCONST 0
IFEQ
IFNE
IF ICMPNE
IF ICMPLE
TABLESWITCHINVOKEVIRTUALIRETURNLRETURNFLOAD
FSTOREGETSTATIC
PUTSTATICFALOAD
FASTORE
DUP

֘౰͢Δ໋ྩDLOAD
ALOAD
DSTOREASTOREDALOADAALOADDASTOREAASTORE
DUP2
DUP X1ANEWARRAY
DADD
ISUB
IDIV
LDIV
LNEG
FNEG
IAND
LAND
I2D
L2I
D2F
I2B

FADD
DMUL
INEG
LUSHR
I2F
D2L
DCMPG
ICONST 0
ICONST 4
FCONST 0
DCONST 1
IFLT
IFGE
IF ICMPLTIF ACMPEQLOOKUPSWITCHINVOKEINTERFACEFRETURN
DRETURN

5. ධՁ࣮‫ݧ‬BALOADCALOAD
BASTORECASTORE
DUP2 X1
DUP X2
MULTIANEWARRAY
LSUB
FSUB
FDIV
DDIV
DNEG
ISHL
IOR
LOR
L2F
L2D
I2C
I2S

ICONST 1
ICONST 5
FCONST 1
ACONST NULL
IFGT
IFLE
IF ICMPGE
IF ACMPNEINVOKESPECIAL
ARETURN
RETURNSALOAD
SASTORE
DUP2 X2

SWAP

DSUB
IREM
LSHL
IXOR
F2I
LCMP

IMUL
LREM
ISHR
LXOR
F2L
FCMPL

ICONST 2
LCONST 0
FCONST 2

LDC
BIPUSH
SIPUSHIFNULLIF ICMPEQ
IF ICMPGTIFNONNULLINVOKESTATIC

F orward(w) ͋Δ source w ΛεϥΠγϯά‫ج‬४ͱͨ͠લ޲͖ Thin Slice ʹ‫·ؚ‬ΕΔ௖఺ͷू߹ɽຊ࣮‫Ͱݧ‬͸ɼJava ϓϩάϥϜͷΫϥεϑΝΠϧΛղੳ

Sink(w) F orward(w) ʹ‫·ؚ‬ΕΔ sink ௖఺ͷू߹ɽ͠ɼ͢΂ͯͷσʔλΛ‫ ͨ͠ͱ఺ج‬Thin Slice Λ‫ܭ‬ଌ͢Δɽ

M ethod(Sts ) Thin Slice Sts ͷ௖఺͕ॴଐ͢Δϝιο

Binkley Βͷ࣮‫ͱݧ‬ಉ༷ʹɼ‫ޙ‬Ζ޲͖ Thin Slice ͱલ޲͖Thin Slice Λ‫͠ࢉܭ‬ɼ֤ RQ ʹରԠͨ͠ࢦඪΛ‫ܭ‬ଌ͢Δɽ

υͷू߹ɽClass(Sts ) Thin Slice Sts ͷ௖఺͕ॴଐ͢ΔΫϥεͷ
ू߹ɽ

5.1 ‫ܭ‬ଌํ๏

RQ1 ʹ ͭ ͍ ͯ ௐ ࠪ ͢ Δ ͨ Ί ʹ ɼ͢ ΂ ͯ ͷ sink v ʹຊ‫Ͱڀݚ‬͸ɼόΠτίʔυͷ໋ྩΛɼ‫࢖ʹࢉܭ‬ΘΕΔ

͍ͭͯ |Backward(v)| Λɼ͢΂ͯͷ source w ʹ͍ͭͯσʔλΛఏ‫͢ڙ‬Δ sourceɼσʔλΛ࢖༻͢Δ sinkɼσʔλ|F orward(w)| Λ‫ܭ‬ଌ͠ɼ͜ΕΒͷฏ‫ۉ‬஋ΛධՁ͢Δɽ

Λ఻೻͢Δ transfer ʹ෼ྨ͢Δɽ2 ߲ԋࢉͰ͋Δ IADD ͷΑ͏ͳԋࢉ͸ɼԋࢉʹ࢖༻͢Δ 2 ͭͷ਺஋ʹؔ͢Δσʔ

RQ2 ʹ͍ͭͯௐࠪ͢ΔͨΊʹɼ͢΂ͯͷ sink v ʹ͍ͭͯ࣍ͷࢦඪΛ‫ܭ‬ଌ͢Δɽ

λϑϩʔͷ sink Ͱ͋Γɼ‫݁ࢉܭ‬ՌΛ࣍ͷ໋ྩʹఏ‫͢ڙ‬Δ• |M ethod(Backward(v))|

source Ͱ΋͋Δɽ·ͨɼϝιου‫ͼݺ‬ग़͠͸ɼ࣮Ҿ਺͕ͦ• |Class(Backward(v))|ΕͧΕ sink Ͱ͋Γɼ໭Γ஋͕࣍ͷ‫ࢉܭ‬ͷͨΊͷ source ͱͳ• |Source(v)|ΔɽϩʔΧϧม਺ͷ୅ೖɼࢀরͷΑ͏ʹɼσʔλࣗମΛม·ͨɼ͢΂ͯͷ source w ʹ͍ͭͯ࣍ͷࢦඪΛ‫ܭ‬ଌ͢Δɽ

ߋ͠ͳ໋͍ྩ͸ transfer ʹ෼ྨͨ͠ɽ۩ମతͳ෼ྨ͸ද 1• |M ethod(F orward(w))|ʹ͍ࣔͯ͠Δɽ

• |Class(F orward(w))|ຊ‫Ͱڀݚ‬͸ɼsink ʹରͯ͠‫ޙ‬Ζ޲͖ Thin Slice Λɼsource• |Sink(w)|ʹରͯ͠લ޲͖ Thin Slice Λ‫͍ͯ͘͠ࢉܭ‬ɽ͜Ε͸༷ʑ

|Source(v)| ͷ஋͕খ͍͞৔߹͸ Thin Slicing Λར༻͢ͳԋࢉ΍ϝιου‫ͼݺ‬ग़͠จɼ৚݅ࣜʹొ৔͢Δม਺΍Δ͜ͱͰɼ࢖༻͍ͯ͠Δσʔλͷੜ੒‫ݩ‬Λগ਺ʹಛఆͰ͖ϑΟʔϧυͷ஋Λௐࠪ͢Δ‫ޙ‬Ζ޲͖εϥΠεͱɼԋࢉͷ݁Δɽಉ༷ʹɼ|Sink(w)| ͷ஋͕খ͍͞৔߹͸ੜ੒ͨ͠σʔՌ΍ม਺ͷ஋͕Ͳ͜Ͱ࢖ΘΕ͍ͯΔ͔Λௐࠪ͢Δલ޲͖ελͷ࢖༻ઌΛগ਺ʹಛఆͰ͖ΔɽϥΠεʹ૬౰͢Δɽtransfer ໋ྩ͸͍ͣΕ΋σʔλͷड͚|M ethod(Backward(v))|ɼ|Class(Backward(v))|ɼ౉͠ͷΈʹରԠ͓ͯ͠ΓɼͦΕΒΛ‫ͯ͠ʹ఺ج‬εϥΠεΛ

|M ethod(F orward(w))|ɼ|Class(F orward(w))| ʹ͍ͭͯ‫ͯ͠ࢉܭ‬΋ɼͦΕͧΕσʔλϑϩʔͰ઀ଓ͞Εͨ sink ΍͸ɼ͜ΕΒͷ஋͕େ͖͍৔߹ɼ༷ʑͳϝιου΍Ϋϥεʹ

source ͔ΒͷεϥΠεͱಉҰͷ݁ՌΛฦ͢͜ͱʹͳΔͨ

·͕ͨͬͨ Thin Slice Ͱ͋Δ͜ͱΛҙຯ͢ΔͨΊɼThinΊɼ‫ܭ‬ଌର৅͔Β͸আ֎ͨ͠ɽ
ຊ‫͍༻Ͱڀݚ‬Δ Thin Slice ʹؔ͢Δද‫ه‬ΛҎԼʹఆٛ͢

Slice ʹΑͬͯϝιου‫ͼݺ‬ग़͠ΛͨͲͬͯσʔλͷੜ੒‫ݩ‬΍࢖༻ઌΛಛఆ͢Δ࡞‫ۀ‬ͷ࣌ؒΛ‫ݮ‬Β͢͜ͱ͕‫ظ‬଴Ͱ͖Δɽ

Δɽ·ͨɼҎԼͷ֤ू߹ S ͷཁૉ਺Λ |S| ͱද‫͢ه‬Δɽ

Backward(v) ͋Δ sink v ΛεϥΠγϯά‫ج‬४ͱͨ͠

5.2 ࣮‫ݧ‬ର৅࣮‫ݧ‬ର৅ͷϓϩάϥϜ͸ DaCapo benchmarkʢ9.12ʣ*1‫ޙ‬Ζ޲͖ Thin Slice ʹ‫·ؚ‬ΕΔ௖఺ͷू߹ɽ

Source(v) Backward(v) ʹ‫·ؚ‬ΕΔ source ௖఺ͷू߹ɽ*1©2013 Information Processing Society of Japan

http://dacapobench.org/

4ソフトウェアエンジニアリングシンポジウム 2013

ද 2࣮‫ݧ‬ର৅ͷϓϩάϥϜ

100%

Table 2 Subject programs

90%
80%

ϓϩάϥϜ໊

Ϋϥε਺

ϝιου਺

άϥϑͷ௖఺਺

tomcat261

2,389

54,468luindex

560

4,180

123,191

sunﬂow

657

4,609

190,526

70%
tomcat

⣼ 60%
✚ 50%
ᗘ
ᩘ 40%

luindexsunflow
avrorapmd

30%

avrora

1,838

9,304

211,343

pmd

2,369

16,439448,722

10%

xalan

2,805

22,377815,861

0%

batik

4,417

28,818968,470

xalan

20%

batik

䝥䝻䜾䝷䝮඲య䛻ᑐ䛩䜛|Backward(v)|䛾๭ྜਤ 2

ͱͨ͠ɽDaCapo benchmark ʹ͸ɼJava ‫͔ॻͰޠݴ‬Εͨଟ਺ͷΞϓϦέʔγϣϯ͕‫·ؚ‬Ε͍ͯΔɽຊ࣮‫Ͱݧ‬ର৅ͱ

|Backward(v)| ͷྦྷੵ౓਺෼෍

Fig. 2 Cumulative frequency distribution for |Backward(v)|ͨ͠ϓϩάϥϜͷ‫ن‬໛͸ද 2 ͷ௨ΓͰ͋Δɽද4

5.3 ࣮‫݁ݧ‬Ռͱߟ࡯ຊ࣮‫ܭͰݧ‬ଌ֤ͨ͠ࢦඪͷ࠷େ஋ͱฏ‫ۉ‬஋Λද 3 ʹࣔ͢ɽ‫ޙ‬Ζ޲͖ Thin Slice ͱલ޲͖ Thin Slice ͷฏ‫ۉ‬஋͸ɼ

7 ͭͷϓϩάϥϜͰฏ‫ͯ͠ۉ‬໿ 2.2%Ͱ͋ΔɽBinkley Βͷ࣮‫[ ݧ‬6] Ͱ͸ɼैདྷͷεϥΠεͷฏ‫ۉ‬஋͕໿ 30% Ͱ͋ͬͨ͜ͱ͔ΒɼThin Slice ͷฏ‫ۉ‬஋͸े෼খ͍͜͞ͱ͕෼͔
Δɽਤ 2 ͸ɼԣ࣠ʹ sink v ͷ |Backward(v)| ͕ϓϩάϥ|M ethod(Backward(v))| ≥ 2 Ͱ͋Γɼ|Source(v)| ͕ 3 ҎԼͰ͋ΔεϥΠεͷׂ߹ʢ%ʣ

Table 4 Ratio of slices whose |M ethod(Backward(v))| ≥ 2
and |Source(v)| ≤ 3|Source(v)|

1

2

3

߹‫ܭ‬

tomcat

2.9

3.6

3.9

10.3

luindex

3.0

4.4

3.5

10.9

sunﬂow

1.7

2.3

2.3

6.3

avrora

3.5

3.7

2.5

9.7

Ϝશମʹ઎ΊΔׂ߹ɼॎ࣠ʹԣ࣠ͷ֤஋ҎԼͰ͋ΔεϥΠ

pmd

2.8

3.5

4.1

10.5

εͷׂ߹Λࣔͨ͠ྦྷੵ౓਺෼෍ਤͰ͋Δɽ͜ͷਤ͔Βɼશ

xalan

2.7

3.4

3.3

9.4

εϥΠεதͷ໿ 60 ͔Β 80%ͷεϥΠε͸ɼͦͷαΠζ͕

batik

2.5

3.5

2.7

8.7

ϓϩάϥϜશମͷ 0.1%ҎԼͰ͋ΔҰํͰɼ࢒Γͷ໿ 20 ͔
Β 40%ͷεϥΠε͸֤ϓϩάϥϜͷεϥΠεͷ࠷େ஋෇ۙ

ΔɽSridharan Β [7] ͸ɼThin Slicing Λར༻͢Δͱσόοʹ෼෍͍ͯ͠ΔɽThin Slicing ͕ಛʹ༗ޮͰ͋Δ৔߹ͱ͠ά࡞‫ۀ‬΍ϓϩάϥϜཧղʹ͔͔Δ͕࣌ؒ‫ݮ‬গ͢Δ͜ͱΛࣔͯɼ‫ޙ‬Ζ޲͖ Thin Slice ͕ෳ਺ͷϝιουʹ·͕ͨΓɼ͔

͍ͯ͠Δɽ͜ΕΒͷ࣮‫͔ݧ‬Βɼ։ൃऀ͕σόοά࡞‫ۀ‬΍ϓͭσʔλͷੜ੒‫͕ݩ‬গͳ͍εϥΠεͷ਺Λද 4 ʹࣔ͢ɽ͜ϩάϥϜཧղΛߦ͏ࡍʹɼσʔλϑϩʔ৘ใΛఏࣔ͢Δ͜

ΕΒͷ 10%ఔ౓ͷεϥΠεʹ͍ͭͯ͸ɼσʔλϑϩʔΛෳͱ͕༗ޮͰ͋Δͱߟ͑ΒΕΔɽ

਺ͷϝιουʹ౉ͬͯ௥੻͍ͯ͘͠࡞‫ۀ‬Λ Thin Slicing ʹ·ͨɼεϥΠεʹؔ͢Δ਺஋ࢦඪʹ͍༷ͭͯʑͳௐ͕ࠪ

Αͬͯஔ͖‫͑׵‬ΒΕΔͨΊɼಛʹ Thin Slicing ͷޮՌ͕ߴߦΘΕ͍ͯΔ [6], [8], [15]ɽBinkley Β͸ɼεϥΠεαΠζ͍ͱߟ͑ΒΕΔɽͷ෼෍Λௐ͓ࠪͯ͠Γ [6]ɼεϥΠεαΠζͷ෼෍Λར༻͠Ҏ্ͷ݁Ռ͔Β RQ1 ʹ͍ͭͯɼThin Slice ͷαΠζ͸ฏͯɼϓϩάϥϜͷߏ଄ͷෳࡶ͞ΛධՁ͢Δख๏ΛఏҊͯ͠‫ۉ‬తʹे෼খ͍͞ͱ‫͑ݴ‬Δɽͨͩ͠ɼεϥΠεͷ෼෍͸ඇ

͍Δ [15]ɽJász Β [8] ͸ɼεϥΠεͷߴ଎ͳۙࣅ‫ࢉܭ‬ͷ݁ৗʹখ͍͞΋ͷͱେ͖͍΋ͷͷ 2 ͭʹ෼͔Ε͓ͯΓɼ͢΂Ռ͕εϥΠεαΠζʹରͯ͠Ͳͷఔ౓େ͖͍͔ͱ͍͏͜ͱ

ͯͷεϥΠεͷαΠζ͕খ͍͞Θ͚Ͱ͸ͳ͍ɽ·ͨɼRQ2

Λௐ͍ࠪͯ͠Δɽ

ʹ͍ͭͯɼද 4 ʹࣔͨ͠Α͏ͳ໿ 10%ͷεϥΠε͕ද͢σʔλϑϩʔ͸ɼσʔλґଘؔ܎ͷௐࠪʹ͓͍ͯಛʹ༗ޮ
Ͱ͋Δͱߟ͑ΒΕΔɽ

6. ؔ࿈‫ڀݚ‬

7. ·ͱΊͱࠓ‫ޙ‬ͷ՝୊ຊ‫Ͱڀݚ‬͸ɼThin Slice ͷαΠζʹؔ͢Δ౷‫ܭ‬తධՁΛߦͬͨɽධՁ࣮‫Ͱݧ‬͸ɼThin Slice ͷαΠζɼσʔλͷੜ੒‫ݩ‬ͷ਺ɼThin Slice ͕·͕ͨΔϝιου਺ͱ͍ͬͨࢦඪ

εϥΠε͕։ൃऀʹ༩͑ΔӨ‫͍ͯͭʹڹ‬ଟ͘ͷ࣮‫ߦ͕ݧ‬Λ‫ܭ‬ଌͨ͠ɽͦͷ݁ՌɼThin Slice ͷαΠζͷฏ‫ۉ‬஋͸ेΘΕ͍ͯΔ [7], [13], [14]ɽIshio Β [13] ͸ɼσʔλϑϩʔΛ෼খ͍͜͞ͱΛ֬ೝͨ͠ɽIshio Β͸ɼ୯७ͳσʔλϑϩʔՄࢹԽ͢Δ͜ͱʹΑͬͯɼ։ൃऀ͕ϓϩάϥϜͷௐࠪΛૣΛՄࢹԽ͢Δ͚ͩͰ΋։ൃऀͷϓϩάϥϜཧղ͕଎͘ͳΔ

͘ߦ͑ΔΑ͏ʹͳΔͱ͍͏͜ͱΛ͍ࣔͯ͠ΔɽKusumoto͜ͱΛ͍ࣔͯ͠Δ [13]ɽThin Slicing ͸‫ݶ‬ఆͨ͠σʔλґΒ [14] ͸ɼεϥΠεΛར༻͢Δ৔߹ͷํ͕ར༻͠ͳ͍৔߹

ଘؔ܎ΛͨͲͬͯ୳ࡧΛߦ͏ͨΊɼͦͷ݁ՌΛ։ൃऀʹఏΑΓσόοά࡞‫ۀ‬ͷ͕࣌ؒૣ͘ͳΔͱ͍͏͜ͱΛ͍ࣔͯ͠

ࣔ͢Δ͜ͱ͸༗ޮͰ͋Δͱߟ͑ΒΕΔɽ

©2013 Information Processing Society of Japan5

ソフトウェアエンジニアリングシンポジウム 2013

ද 3 ֤ࢦඪͷ౷‫ྔܭ‬

Table 3 Summary of metricsάϥϑͷશ௖఺਺

|Backward(v)||F orward(w)|tomcatluindex

sunﬂow

avrora

pmd

xalan

batik

54,468123,191

190,526

211,343448,722815,861

968,470
93,810࠷େ஋

922

12,82034,51230,45840,78462,957࠷େ஋ͷׂ߹ʢ%ʣ

1.7

10.4

18.1

14.4

9.1

7.7

9.7

ฏ‫ۉ‬஋

55.2

3012.811264.96919.37108.612482.7

26159.3ฏ‫ۉ‬஋ͷׂ߹ʢ%ʣ

0.10

2.4

5.9

3.3

1.6

1.5

2.7

࠷େ஋

3,673

23,63343,041

27,592

52,339105,749

140,965࠷େ஋ͷׂ߹ʢ%ʣ

6.7

19.2

22.6

13.1

11.7

13.0

14.7

ฏ‫ۉ‬஋

57.2

1434.07834.82386.06226.318481.928719.3ฏ‫ۉ‬஋ͷׂ߹ʢ%ʣ

0.11

1.2

4.1

1.1

1.4

2.3

3.0

࠷େ஋

193

1,342

2,010

3,780

4,277

6,849

7,326

ฏ‫ۉ‬஋

8.0

155.6

155.7

128.7

126.5

385.5

576.9

࠷େ஋

368

1,852

2,449

3,702

3,132

7,175

8,011

ฏ‫ۉ‬஋

6.4

116.1

230.2

331.0

369.6

1267.11632.0|M ethod(Backward(v))||M ethod(F orward(w))||Class(Backward(v))||Class(F orward(w))||Source(v)||Sink(w)|

࠷େ஋

41

288

338

1,284

685

1,352

1,792

ฏ‫ۉ‬஋

2.9

68.4

112.8

278.0

111.3

264.9

489.7

࠷େ஋

68

375

348

1,147

507

1,306

1,750

ฏ‫ۉ‬஋

2.3

35.9

46.2

98.9

67.0

243.4

361.6

࠷େ஋

382

5,494

15,451

14,96418,90027,441

40,687

ฏ‫ۉ‬஋

25.3

1371.45218.13470.63076.65215.611183.8

࠷େ஋

1,610

9,216

17,369

11,68919,42541,42352,334

ฏ‫ۉ‬஋

25.4

537.6

3031.91021.42264.27238.510662.3ࠓ‫ޙ‬ͷ՝୊ͱͯ͠ɼThin Slice ͷ಺༰ʹ͍ͭͯৄࡉͳௐ
ࠪΛߦ͏͜ͱ͕ߟ͑ΒΕΔɽຊ࣮‫Ͱݧ‬໿ 20 ͔Β 40%ͷε

[7]ϥΠεʹ͍ͭͯɼͦͷαΠζ͕େ͖͘ͳͬͯ͠·͏͜ͱ͕෼͔ͬͨɽ͔͠͠ɼͦͷΑ͏ͳεϥΠε͕ͲͷΑ͏ͳσʔλϑϩʔͰ͋Δ͔͸෼͔͍ͬͯͳ͍ͨΊɼεϥΠεαΠζ[8]͕େ͖͘ͳΔ‫ݪ‬ҼΛௐࠪ͢Δ͜ͱ͕ඞཁͰ͋Δɽ·ͨɼ[7]ʹ͓͍ͯ Thin Slicing ͷఆੑతͳ༗ޮੑ͸ௐࠪ͞Ε͍ͯ
Δ͕ɼఆྔతͳධՁ΋ඞཁͰ͋Δɽ͞ΒʹɼࣛౡΒͷπʔ[9]

ϧ [16] ͱ૊Έ߹ΘͤΔ͜ͱͰɼϝιουͷҾ਺ʹ༩͑ΒΕΔσʔλͷੜ੒‫ݩ‬ΛՄࢹԽ͠ɼσʔλґଘؔ܎ͷௐࠪΛࢧԉ͢Δ͜ͱ͕ߟ͑ΒΕΔɽँࣙຊ‫ڀݚ‬͸ɼ೔ຊֶज़ৼ‫ڵ‬ձՊֶ‫ڀݚ‬අิॿۚ‫ج‬[10]൫‫ڀݚ‬ʢSʣ
ʢ՝୊൪߸:25220003ʣ
ɼएख‫ڀݚ‬ʢAʣ
ʢ՝୊൪
߸:23680001ʣͷॿ੒Λಘͨɽ[11]ࢀߟจ‫ݙ‬
[1]

[2]

[3]

[4]

[5]

[6]

Corbi, T. A.: Program understanding: challenge for the
1990’s, IBM Systems Journal, Vol. 28, No. 2, pp. 294–
306 (1989).
LaToza, T. D., Venolia, G. and DeLine, R.: Maintaining
mental models: a study of developer work habits, Proceedings of the 28th ACM/IEEE International Conference on Software Engineering, pp. 492–501 (2006).
LaToza, T. D. and Myers, B. A.: Developers ask reachability questions, Proceedings of the 32nd ACM/IEEEInternational Conference on Software Engineering Volume 1, pp. 185–194 (2010).
Wang, J., Peng, X., Xing, Z. and Zhao, W.: An exploratory study of feature location process: Distinct
phases, recurring patterns, and elementary actions, Proceedings of the 27th IEEE International Conference on
Software Maintenance, pp. 213–222 (2011).
Weiser, M.: Program slicing, Proceedings of the 5thIEEE International Conference on Software Engineering, pp. 439–449 (1981).
Binkley, D., Gold, N. and Harman, M.: An empirical
study of static program slice size, ACM Transactions on
Software Engineering and Methodology, Vol. 16, No. 2,©2013 Information Processing Society of Japan

[12]

[13]

[14]

[15]

[16]

pp. 1–32 (2007).
Sridharan, M., Fink, S. J. and Bodik, R.: Thin slicing, Proceedings of the 2007 ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 112–122 (2007).
Jász, J., Árpád Beszédes, Gyimóthy, T. and Rajlich, V.:
Static Execute After/Before as a Replacement of Traditional Software Dependencies, Proceedings of the 24th
IEEE International Conference on Software Maintenance, pp. 137–146 (2008).
Horwitz, S., Reps, T. and Binkley, D.: Interprocedural slicing using dependence graphs, Proceedings ofthe 1988 ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 35–46(1988).
Andersen, L. O.: Program Analysis and Specialization
for the C Programming Language, PhD Thesis, University of Copenhagen (1994).
Milanova, A., Rountev, A. and Ryder, B. G.: Parameterized object sensitivity for points-to analysis for
Java, ACM Transactions on Software Engineering andMethodology, Vol. 14, No. 1, pp. 1–41 (2005).
Sundaresan, V., Hendren, L., Razaﬁmahefa, C., ValléeRai, R., Lam, P., Gagnon, E. and Godin, C.: Practical virtual method call resolution for Java, Proceedings of the 15th ACM SIGPLAN Conference on Objectoriented Programming, systems, languages, and applications, pp. 264–280 (2000).
Ishio, T., Etsuda, S. and Inoue, K.: A lightweight visualization of interprocedural data-ﬂow paths for sourcecode reading., Proceedings of the 20th IEEE International Conference on Program Comprehension, pp. 37–
46 (2012).
Kusumoto, S., Nishimatsu, A., Nishie, K. and Inoue, K.:
Experimental Evaluation of Program Slicing for Fault
Localization, Empirical Software Engineering, Vol. 7,
No. 1, pp. 49–76 (2002).
Binkley, D. and Harman, M.: Locating Dependence
Clusters and Dependence Pollution, Proceedings of the
21st IEEE International Conference on Software Maintenance, pp. 177–186 (2005).
ࣛౡɹ༔ɼੴඌɹོɼҪ্ࠀ࿠ɿΤΠϦΞεղੳΛ༻͍ͨϝιουͷೖྗσʔλͷར༻๏ՄࢹԽπʔϧɼιϑτ΢ΣΞΤϯδχΞϦϯάγϯϙδ΢Ϝ 2012 ࿦จू, pp1-8(2012).

6