ࢯࣇࢺ࢙࢘࢔⌮ゎᨭ᥼ࢆ┠ⓗ࡜ࡋࡓ㎡᭩ࡢసᡂἲ᪩ ℩ ᗣ ⿱†1ᕷ ஭ㄔ†1஭ ୖ ඞ 㑻†1ᮏ◊✲࡛ࡣ㸪ࢯࣇࢺ࢙࢘࢔⌮ゎࢆᨭ᥼ࡍࡿࡓࡵ࡟㸪ࢯࣇࢺ࢙࢘࢔୰࡛⏝࠸ࡽࢀࡿ༢ㄒࡢ㎡᭩ࢆ⮬ືⓗ࡟సᡂࡍࡿᡭἲࢆࡍࡿ㸬సᡂࡍࡿ㎡᭩࡟ࡣ㸪㆑ูᏊ࡟⏝࠸ࡽࢀࡿྡモ࡜ಟ㣭ㄒ㸪ࡑࡋ࡚ࡑࡢ㛫ࡢ㛵ಀࡀグ㘓ࡉࢀࡿ㸬

A Novel Approach for Building a Thesaurus for Program Comprehension
Yasuhiro Hayase,†1 Makoto Ichii†1 and Katsuro Inoue †1
We propose a method for building a thesaurus that helps program comprehension. Thethesaurus conatins nominal or adjective words and relations between the words.

1. ࡣ ࡌ ࡵ ࡟ࢯ࣮ࣛࢫ㸧ࢆసᡂࡍࡿᡭἲࢆᥦ᱌ࡍࡿ㸬ࡇࡢࢩࢯ࣮ࣛ㏆ᖺ㸪ࢯࣇࢺ࢙࢘࢔ಖᏲ࡟࠿࠿ࡿࢥࢫࢺࡢቑ኱ࡀၥࡍࡿࡇ࡜ࡀฟ᮶ࡿࡼ࠺࡟࡞ࡿ࡜ᮇᚅࡉࢀࡿ㸬㢟࡜࡞ࡗ࡚࠸ࡿ㸬ࢯࣇࢺ࢙࢘࢔ࢆኚ᭦ࡍࡿࡓࡵ࡟ࡣᑐ㇟ࢯࣇࢺ࢙࢘࢔ࢆヲ⣽࡟⌮ゎࡍࡿᚲせࡀ࠶ࡿࡀ㸪ࢯࣇࢫࢆ⏝࠸ࡿࡇ࡜࡛㸪ᑐ㇟ࢯࣇࢺ࢙࢘࢔ࢆຠ⋡ⓗ࡟⌮ゎ

2. ᥦ ᱌ ᡭ ἲࢺ࢙࢘࢔࡟௜㝶ࡍࡿ࡭ࡁࢻ࣓࢟ࣗࣥࢺࡣ㸪ࢯࣇࢺ࢙࢘

ᥦ᱌ᡭἲࡢᴫせࢆᅗ 1 ࡟♧ࡍ㸬࢔ಖᏲࡢ㐣⛬࡛㐺ษ࡟ኚ᭦ࡉࢀ࡞࠸ࡇ࡜ࡀከ࠸1) ࡓᡭἲࡢධຊࡣ࢜ࣈࢪ࢙ࢡࢺᣦྥࣉࣟࢢ࣑ࣛࣥࢢゝㄒࡵ㸪ࢯࣇࢺ࢙࢘࢔ࢆ⌮ゎࡍࡿ࡟ࡣࢯ࣮ࢫࢥ࣮ࢻࢆㄞࡳ㸪࡛᭩࠿ࢀࡓࢯ࣮ࢫࢥ࣮ࢻ࡛࠶ࡾ㸪 ฟຊࡣྡモࡢୖ఩⌮ゎࡋ࡞ࡅࢀࡤ࡞ࡽ࡞࠸2) 㸬ୗ఩㛵ಀ࡜㸪ྡモ࡜ಟ㣭ㄒࡢ㛵ಀࢆグ㘓ࡋࡓࢢࣛࣇᵓࢯ࣮ࢫࢥ࣮ࢻࢆ⌮ゎࡍࡿ㝿࡟㸪ಖᏲసᴗ⪅ࡣᵝࠎ࡞㐀ࡢ㎡᭩࡛࠶ࡿ㸬ᡭࡀ࠿ࡾࢆ฼⏝ࡍࡿࡀ㸪ࢯ࣮ࢫࢥ࣮ࢻ୰࡟ฟ⌧ࡍࡿ㆑ᥦ᱌ᡭἲࡣ㸪ࡲࡎࢯ࣮ࢫࢥ࣮ࢻ㞟ྜࢆᵓᩥゎᯒࡋ㸪ูᏊࡢྡ๓ࡣ㠀ᖖ࡟㔜せ࡞ᡭࡀ࠿ࡾࡢ 1 ࡘ࡛࠶ࡿ࡜ゝ㆑ูᏊྡ࡜ࡑࢀࡽࡢ㛫ࡢ is-a 㛵ಀ (୍᪉ࡀࡶ࠺୍ࡘࡢࢃࢀ࡚࠸ࡿ㸬ලయⓗ࡟ࡣ㸪ಖᏲసᴗ⪅ࡀࢯ࣮ࢫࢥ࣮ࢻලయ౛࡟࡞ࡗ࡚࠸ࡿ㛵ಀ) ࢆྲྀᚓࡍࡿ㸬୍⯡࡟㸪㆑ูࢆ⌮ゎࡍࡿ᫬࡟ࡣ㸪ࡑࡢࣉࣟࢢ࣒ࣛࡢ౑ࢃࢀࡿࢻ࣓࢖Ꮚྡࡣ」ᩘࡢ༢ㄒࢆ㐃⤖ࡋࡓࡶࡢ (」ྜㄒ) ࡛࠶ࡿࡇࣥࡢ▱㆑࡜ࣉࣟࢢ࣒ࣛせ⣲࡜ࡢᑐᛂ௜ࡅ࡟㆑ูᏊࡢྡ࡜ࡀከ࠸㸬ࡑࡇ࡛㸪」ྜㄒࢆษࡾศࡅ㸪༢ㄒࡢิࢆస๓ࢆ⏝࠸ࡿ3)4) 㸬ࡇࡢࡓࡵ㸪㆑ูᏊ࡟㐺ษ࡞ྡ๓ࡀ௜

ᡂࡍࡿ㸬is-a 㛵ಀࡢලయ౛࡜ࡋ࡚ࡣ㸪ࢡࣛࢫࡸ࢖ࣥࢱࡅࡽࢀ࡚࠸࡞࠸ሙྜ࡟ࡣ㸪ࢯ࣮ࢫࢥ࣮ࢻࢆ⌮ゎࡍࡿࡓࣇ࢙࣮ࢫࡢ⥅ᢎࡸᐇ⿦㛵ಀࡸ㸪ኚᩘ࡜ࡑࡢᆺࡢ㛵ಀࡀࡵ࡟Ⳙ኱࡞᫬㛫ࢆᚲせ࡜ࡋ࡚ࡋࡲ࠺5) 㸬࠶ࡿ㸬ࡲࡓ㸪㆑ูᏊ࡟㐺ษ࡞ྡ๓ࡀ௜ࡅࡽࢀ࡚࠸ࡓ࡜ࡋ࡚ḟ࡟㸪༢ㄒิࡢ㛫ࡢ is-a 㛵ಀࢆゎᯒࡍࡿ㸬ゎᯒ⤖ࡶ㸪సᴗ⪅ࡀಖᏲᑐ㇟ࡢࢯࣇࢺ࢙࢘࢔࡟୙័ࢀ࡞ሙྜᯝࡣ㸪௨ୗࡢ 3 ࡘ࡟ศ㢮ࡉࢀࡿ㸬࡟ࡣ㸪ࣉࣟࢢ࣒ࣛせ⣲࡜▱㆑࡜ࡢᑐᛂ௜ࡅࡀୖᡭࡃฟ୍᪉ࡢ༢ㄒิࡀࡶ࠺୍᪉࡟ྵࡲࢀࡿሙྜ 㛗࠸༢ㄒิ᮶࡞࠸㸬ࡇࡢࡇ࡜ࡀ㸪ᑐ㇟ࢯࣇࢺ࢙࢘࢔࡟⇍⦎ࡋ࡚࠸࠿ࡽ▷࠸༢ㄒิࢆ㝖࠸ࡓ༢ㄒิࢆಟ㣭ㄒ࡜ࡋ࡚ᢳࡿ⪅࡟ẚ࡭࡚㸪ಖᏲసᴗ࡟㛗࠸᫬㛫ࡀ࠿࠿ࡗ࡚ࡋࡲ࠺ཎᅉࡢ 1 ࡘ࡟࡞ࡗ࡚࠸ࡿ࡜⪃࠼ࡽࢀࡿ㸬ฟࡍࡿ㸬
ඹ㏻ࡋ࡚⌧ࢀࡿ㒊ศ༢ㄒิࡀ࠶ࡿሙྜ ඹ ㏻ ࡍ ࡿ 㒊ࡑࡇ࡛㸪ᮏ◊✲࡛ࡣࢯ࣮ࢫࢥ࣮ࢻ୰࡟ฟ⌧ࡍࡿ༢ㄒศࢆ㝖࠸ࡓ 2 ࡘࡢ༢ㄒิࢆ㸪ྡモࡢୖ఩ୗ఩㛵࡜ࡑࡢ㛫ࡢ㛵ಀ࠿ࡽ㸪༢ㄒ㛫ࡢ㛵ಀࢆグࡋࡓ㎡᭩㸦ࢩಀ࡜ࡋ࡚ᢳฟࡍࡿ㸬ࡲࡓ㸪ඹ㏻ࡍࡿ㒊ศࢆಟ㣭ㄒ࡜ࡋ࡚ᢳฟࡍࡿ㸬†1 ኱㜰኱Ꮫ ኱Ꮫ㝔᝟ሗ⛉Ꮫ◊✲⛉
Osaka Universityࡑࢀ௨እࡢሙྜ 2 ࡘࡢ༢ㄒิࢆ㸪ྡモࡢୖ఩ୗ఩㛵ಀ࡜ࡋ࡚ᢳฟࡍࡿ㸬ソースコード
集合

List
JList
List
LinkedList…

Component
JComponent
Collection
List…

collection




componentlistjlinked is-a 関係シソーラス
ᅗ1ᡭἲࡢᴫせᢳฟࡋࡓ㛵ಀࡸ༢ㄒࡀ㸪ணࡵᐃࡵࡓ㜈್௨ୖࡢᅇᩘ
ฟ⌧ࡋࡓ࡞ࡽࡤ㸪㎡᭩࡟Ⓩ㘓ࡍࡿ㸬

3. 㛵 㐃 ◊ ✲ᑐ㇟ࢯࣇࢺ࢙࢘࢔࡟୙័ࢀ࡞ಖᏲసᴗ⪅࡛࠶ࡗ࡚ࡶຠ⋡ⓗ࡞ಖᏲసᴗࢆྍ⬟࡟ࡍࡿࡓࡵ࡟㸪ಖᏲసᴗ⪅࡟㐺ษ࡞▱㆑ࢆ୚࠼ࡿ◊✲ࡀ⾜ࢃࢀ࡚࠸ࡿ㸬Caprile ࡽ6) ࡣ㸪C ゝㄒࡢ㛵ᩘྡࡢᵓ㐀ࢆᐃ⩏ࡋ㸪㛵ᩘྡ࡟⏝࠸ࡽࢀࡿㄒᙡࡢ㎡᭩ࢆసᡂࡋࡓ㸬ࡉࡽ࡟㸪ࡑࡢ㎡᭩ࢆ⏝࠸࡚㛵ᩘྡࡢ෌ᵓ⠏ࢆᨭ᥼ࡍࡿᡭἲࢆᥦ᱌ࡋࡓ㸬ࡇࡢᡭἲ࡛ࡣ㸪ᑐ㇟࡜ࡍࡿࢯࣇࢺ࢙࢘࢔ẖ࡟㸪㛵ᩘྡࡢṇつᩥἲࢆᡭື࡛సᡂࡋ࡞ࡅࢀࡤ࡞ࡽ࡞࠸࡜࠸࠺ၥ㢟ࡀ࠶ࡿ㸬Host ࡽ7) ࡣ㸪࣓ࢯࢵࢻࡢ࿨ྡసᴗࢆᨭ᥼ࡍࡿࡇ࡜ࢆ┠ⓗ࡜ࡋ࡚㸪᪤Ꮡࡢ Java ࢯ࣮ࢫࢥ࣮ࢻࢆゎᯒࡋ㸪࣓ࢯࢵࢻྡ࡟⏝࠸ࡽࢀࡿືモࡢព࿡ࢆㄝ᫂ࡋࡓ㎡᭩ࢆసᡂࡋࡓ㸬Antoniol ࡽ8) ࡣ㸪ࣉࣟࢢ࣒ࣛ୰ࡢ㆑ูᏊ࡟⏝࠸ࡽࢀ࡚࠸ࡿㄒᙡࡀ㸪㛤Ⓨࡢ㐍⾜࡟కࡗ࡚࡝࠺ኚ໬ࡍࡿ࠿࡟ࡘ࠸࡚ㄪᰝࡋࡓ㸬

4. ᑗ᮶ࡢㄢ㢟ࢯ࣮ࢫࢥ࣮ࢻ㞟ྜࢆゎᯒࡋ㸪ࢩࢯ࣮ࣛࢫࢆసᡂࡍࡿࢩࢫࢸ࣒ࡣᐇ⿦῭ࡳ࡛࠶ࡿ㸬ḟ࡟㸪సᡂࡋࡓࢩࢯ࣮ࣛࢫ࡟㸪⮬↛ゝㄒ࡜ࡣ␗࡞ࡿ༢ㄒࡸ㛵ಀࡀᏑᅾࡍࡿ࠿࡟ࡘ࠸࡚ㄪᰝࡍࡿࡓࡵ࡟㸪సᡂࡋࡓࢩࢯ࣮ࣛࢫ࡜ WordNet ࡞࡝ࡢ⮬↛ゝㄒࡢࢩࢯ࣮ࣛࢫ࡜ࢆẚ㍑ࡍࡿࡇ࡜ࢆィ⏬ࡋ࡚࠸ࡿ㸬ࡉࡽ࡟㸪ࢩࢯ࣮ࣛࢫ࠿ࡽ୙㐺ษ࡞༢ㄒࡸ㛵ಀࢆ㝖ཤࡍࡿࡓࡵ࡟㸪ࡼࡾ㐺ษ࡞㜈್ࡢタᐃ᪉ἲࢆ⪃᱌ࡍࡿ㸬୍⯡࡟㸪ࢯ࣮ࢫࢥ࣮ࢻࡢእ㒊࠿ࡽ฼⏝ࡉࢀࡿ㆑ูᏊࡣ⇍៖ࡋ࡚ྡ௜ࡅࡽࢀࡿࡓࡵ㐺ษ࡞ྡ๓ࡀ௜ࡅࡽࢀࡿࡇ࡜ࡀከ࠸ࡀ㸪ෆ㒊ࡢࡳ࡛౑⏝ࡉࢀࡿ㆑ูᏊࡢྡ๓࡟ࡣ࠶ࡲࡾὀពࡀᡶࢃࢀ࡞࠸㸬ࡑࡇ࡛㸪ࡇࡢᛶ㉁ࢆ฼⏝ࡋ㸪ࢯ࣮ࢫࢥ࣮ࢻෆ࠿ࡽࡢࡳཧ↷ྍ⬟࡞㆑ูᏊࡸ㸪እ㒊࠿ࡽࡢཧ↷ࡀᑡ࡞࠸㆑ูᏊ࠿ࡽྲྀᚓࡋࡓ༢ㄒ㛫ࡢ㛵ಀࡣ㸪ྠࡌ㛵ಀࡀ」ᩘࡢࢯ࣮ࢫࢥ࣮ࢻ࡛ฟ⌧ࡋࡓ᫬ࡢࡳࢩࢯ࣮ࣛࢫ࡟Ⓩ㘓ࡍࡿࡼ࠺࡟ࡍࢀࡤⰋ࠸ࡢ࡛ࡣ࡞࠸
࠿࡜⪃࠼࡚࠸ࡿ㸬እ㒊࠿ࡽࡢཧ↷ࡢከࡉࡢᇶ‽࡜ࡋ࡚ࡣ㸪 fan-in ࡸ Component Rank ್ (ᐇ⦼࡟ᇶࡃ෌฼⏝ᛶࡢᑻᗘ) ࢆ⏝࠸ࡿࡇ࡜ࢆ⪃࠼࡚࠸ࡿ㸬௨ୖ࡟ຍ࠼㸪సᡂࡋࡓࢩࢯ࣮ࣛࢫࢆຠᯝⓗ࡟ᥦ♧ࡍࡿ࣮ࣘࢨ࢖ࣥࢱࣇ࢙࣮ࢫࢆసᡂࡍࡿࡇ࡜ࡶᚲせ࡛࠶ࡿ㸬ཧ⪃ᩥ⊩1) LaToza, T. D., Venolia, G. and DeLine, R.:
Maintaining mental models: a study of developer work habits, ICSE ’06, New York, NY,USA, ACM, pp.492–501 (2006).
2) LaToza, T.D., Garlan, D., Herbsleb, J.D. andMyers, B. A.: Program comprehension as fact
ﬁnding, ESEC-FSE ’07, New York, NY, USA,ACM, pp.361–370 (2007).
3) von Mayrhauser, A. and Vans, A.M.: Identiﬁcation of Dynamic Comprehension Processes
During Large Scale Maintenance, IEEE Trans.
Softw. Eng., Vol.22, No.6, pp.424–437 (1996).
4) Pennington, N.: Comprehension strategies inprogramming, pp.100–113 (1987).
5) Lawrie, D., Morrell, C., Feild, H. and Binkley,
D.: What’s in a Name? A Study of Identiﬁers,
ICPC ’06, Washington, DC, USA, IEEE Computer Society, pp.3–12 (2006).
6) Caprile, B. and Tonella, P.: Restructuring
Program Identiﬁer Names, ICSM ’00, Washington, DC, USA, IEEE Computer Society,p.97 (2000).
7) Host, E.W. and Ostvold, B.M.: The Programmer’s Lexicon, Volume I: The Verbs, SCAM
’07, Washington, DC, USA, IEEE Computer
Society, pp.193–202 (2007).
8) Antoniol, G., Gueheneuc, Y.-G., Merlo, E.
and Tonella, P.: Mining the Lexicon Used byProgrammers during Sofware Evolution, ICSM
’07, Washington, DC, USA, IEEE Computer
Society, pp.14–23 (2007).