,... Web,.,.,,.,...,.,,,, i



Similar documents
. IDE JIVE[1][] Eclipse Java ( 1) Java Platform Debugger Architecture [5] 3. Eclipse GUI JIVE 3.1 Eclipse ( ) 1 JIVE Java [3] IDE c 016 Information Pr

,,,,., C Java,,.,,.,., ,,.,, i

Web Web Web Web i

Sobel Canny i

,,.,.,,.,.,.,.,,.,..,,,, i

PowerPoint Presentation


soturon.dvi

1., 1 COOKPAD 2, Web.,,,,,,.,, [1]., 5.,, [2].,,.,.,, 5, [3].,,,.,, [4], 33,.,,.,,.. 2.,, 3.., 4., 5., ,. 1.,,., 2.,. 1,,

23 Study on Generation of Sudoku Problems with Fewer Clues

7,, i

24 Region-Based Image Retrieval using Fuzzy Clustering

Virtual Window System Virtual Window System Virtual Window System Virtual Window System Virtual Window System Virtual Window System Social Networking

226

SOM SOM(Self-Organizing Maps) SOM SOM SOM SOM SOM SOM i

新・明解Java入門

Web Basic Web SAS-2 Web SAS-2 i

CX-Checker CX-Checker (1)XPath (2)DOM (3) 3 XPath CX-Checker. MISRA-C 62%(79/127) SQMlint 76%(13/17) XPath CX-Checker 3. CX-Checker 4., MISRA-C CX- Ch

オブジェクト脳のつくり方

1 1 tf-idf tf-idf i

TF-IDF TDF-IDF TDF-IDF Extracting Impression of Sightseeing Spots from Blogs for Supporting Selection of Spots to Visit in Travel Sat

kut-paper-template.dvi

P2P P2P Winny 3 P2P P2P 1 P2P, i

4.1 % 7.5 %

28 Horizontal angle correction using straight line detection in an equirectangular image

17 Proposal of an Algorithm of Image Extraction and Research on Improvement of a Man-machine Interface of Food Intake Measuring System

FabHetero FabHetero FabHetero FabCache FabCache SPEC2000INT IPC FabCache 0.076%

Microsoft Word - toyoshima-deim2011.doc

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV

( ) [1] [4] ( ) 2. [5] [6] Piano Tutor[7] [1], [2], [8], [9] Radiobaton[10] Two Finger Piano[11] Coloring-in Piano[12] ism[13] MIDI MIDI 1 Fig. 1 Syst

22 Google Trends Estimation of Stock Dealing Timing using Google Trends

A B 1: Ex. MPICH-G2 C.f. NXProxy [Tanaka] 2:

28 Docker Design and Implementation of Program Evaluation System Using Docker Virtualized Environment

29 Short-time prediction of time series data for binary option trade


Java演習(4) -- 変数と型 --

1 Fig. 1 Extraction of motion,.,,, 4,,, 3., 1, 2. 2.,. CHLAC,. 2.1,. (256 ).,., CHLAC. CHLAC, HLAC. 2.3 (HLAC ) r,.,. HLAC. N. 2 HLAC Fig. 2

WebRTC P2P Web Proxy P2P Web Proxy WebRTC WebRTC Web, HTTP, WebRTC, P2P i

デザインパターン第一章「生成《

1 [1, 2, 3, 4, 5, 8, 9, 10, 12, 15] The Boston Public Schools system, BPS (Deferred Acceptance system, DA) (Top Trading Cycles system, TTC) cf. [13] [

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value =

TopLink å SampleClient.java... 5 Ò readallsample() querysample() cachesample() Ç..

2 ( ) i

PatternFigures.ai

IT,, i

29 jjencode JavaScript

Exam : 1z1-809-JPN Title : Java SE 8 Programmer II Vendor : Oracle Version : DEMO Get Latest & Valid 1z1-809-JPN Exam's Question and Answers 1 from Ac

DEIM Forum 2009 B4-6, Str

, IT.,.,..,.. i

& Vol.5 No (Oct. 2015) TV 1,2,a) , Augmented TV TV AR Augmented Reality 3DCG TV Estimation of TV Screen Position and Ro

Core Ethics Vol. Nerriere D.Hon EU GS NPO GS GS Oklahoma State University Kyoto Branch OSU-K OSU-K OSU-K

Web Stamps 96 KJ Stamps Web Vol 8, No 1, 2004

58 10

DTN DTN DTN DTN i

11 ソフトウェア工学 Software Engineering デザインパターン DESIGN PATTERNS デザインパターンとは? デザインパターン 過去のソフトウェア設計者が生み出したオブジェクト指向設計に関して, ノウハウを蓄積し 名前をつけ 再利用しやすいようにカタログ化したもの 各デ

シミュレーションの簡単な例 GUI 無しのシミュレーションを作る GUI を作る パラメタを設定するデモンストレーションをする 2 オブジェクト指向プログラミング特論

DEIM Forum 2009 C8-4 QA NTT QA QA QA 2 QA Abstract Questions Recomme

やさしいJavaプログラミング -Great Ideas for Java Programming サンプルPDF

Web Web ID Web 16 Web Web i

20 Method for Recognizing Expression Considering Fuzzy Based on Optical Flow

Table 1. Reluctance equalization design. Fig. 2. Voltage vector of LSynRM. Fig. 4. Analytical model. Table 2. Specifications of analytical models. Fig


P2P P2P peer peer P2P peer P2P peer P2P i

Microsoft PowerPoint ppt

VB.NETコーディング標準

149 (Newell [5]) Newell [5], [1], [1], [11] Li,Ryu, and Song [2], [11] Li,Ryu, and Song [2], [1] 1) 2) ( ) ( ) 3) T : 2 a : 3 a 1 :

システム開発プロセスへのデザイン技術適用の取組み~HCDからUXデザインへ~


Steel Construction Vol. 6 No. 22(June 1999) Engineering


Table 1. Assumed performance of a water electrol ysis plant. Fig. 1. Structure of a proposed power generation system utilizing waste heat from factori

IPSJ SIG Technical Report Vol.2010-CVIM-170 No /1/ Visual Recognition of Wire Harnesses for Automated Wiring Masaki Yoneda, 1 Ta

25 Removal of the fricative sounds that occur in the electronic stethoscope

Web Web Web Web Web, i

Studies of Foot Form for Footwear Design (Part 9) : Characteristics of the Foot Form of Young and Elder Women Based on their Sizes of Ball Joint Girth

PC PDA SMTP/POP3 1 POP3 SMTP MUA MUA MUA i

DEIM Forum 2009 E

橡自動車~1.PDF

Vol.54 No (July 2013) [9] [10] [11] [12], [13] 1 Fig. 1 Flowchart of the proposed system. c 2013 Information

2reN-A14.dvi

Vol. 48 No. 4 Apr LAN TCP/IP LAN TCP/IP 1 PC TCP/IP 1 PC User-mode Linux 12 Development of a System to Visualize Computer Network Behavior for L

IPSJ SIG Technical Report Vol.2010-SLDM-144 No.50 Vol.2010-EMB-16 No.50 Vol.2010-MBL-53 No.50 Vol.2010-UBI-25 No /3/27 Twitter IME Twitte

エンタープライズサーチ・エンジンQ u i c k S o l u t i o n ® の開発

28 TCG SURF Card recognition using SURF in TCG play video

19 Systematization of Problem Solving Strategy in High School Mathematics for Improving Metacognitive Ability

1 Web [2] Web [3] [4] [5], [6] [7] [8] S.W. [9] 3. MeetingShelf Web MeetingShelf MeetingShelf (1) (2) (3) (4) (5) Web MeetingShelf

untitled

2007-Kanai-paper.dvi

untitled

23 The Study of support narrowing down goods on electronic commerce sites

Web Web Web Web 1 1,,,,,, Web, Web - i -

paper.dvi

161 J 1 J 1997 FC 1998 J J J J J2 J1 J2 J1 J2 J1 J J1 J1 J J 2011 FIFA 2012 J 40 56

13 RoboCup The Interface System for Learning By Observation Applied to RoboCup Agents Ruck Thawonmas

「メンバー紹介」

IPSJ SIG Technical Report Vol.2011-MUS-91 No /7/ , 3 1 Design and Implementation on a System for Learning Songs by Presenting Musical St

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value =

Vol. 42 No. SIG 8(TOD 10) July HTML 100 Development of Authoring and Delivery System for Synchronized Contents and Experiment on High Spe

THE INSTITUTE OF ELECTRONICS, INFORMATION AND COMMUNICATION ENGINEERS TECHNICAL REPORT OF IEICE.

main.dvi

Transcription:

22 Proposal of a Design Pattern Retrieval Method with Partial Source Code Queries 1110295 2011 3 1

,... Web,.,.,,.,...,.,,,, i

Abstract Proposal of a Design Pattern Retrieval Method with Partial Source Code Queries Yasuo YAMASAKI When finding a solution to a recurring problem in designing object-oriented software, a designer can consider the use of design patterns. Design patterns are descriptions that document good historical solutions for recurring design problems. A designer can make well-designed software by using design patterns. The necessity for a search system for design patterns is increasing because design patterns are continuously produced on books and web pages. Therefore, a pattern search system with keyword queries has been researched. In this paper, a design pattern retrieval method with partial source code queries is proposed. The proposed method extracts pattern s structure from source code s structure by focusing on generalization relationship and retrieves patterns by calculating similarity score between the source code and each pattern. The algorithm that calculates similarity between graph vertices is used for calculating similarity score. Finaly, the results of an a experiment where we apply the proposed method to partial source code show its validness for the desired pattern retrieval. key words design pattern, search, matrix, similarity, generalization relationship ii

1 1 2 4 2.1................. 4 2.2........................... 4 2.3........................ 6 3 8 3.1................................ 8 3.2................................ 9 3.2.1..................... 9 3.2.2........ 11 4 15 5 17 18 19 A 20 A.1 Command............................. 20 A.2 Adapter.............................. 21 A.3 Factory Method.......................... 23 A.4 Proxy............................... 24 A.5 Composite............................. 27 iii

1.1 Command........................ 3 1.2....................... 3 1.3.......................... 3 2.1 Command........ 5 3.1.... 12 3.2................... 13 3.3 factory method..................................... 13 3.4..... 13 3.5...................... 14 3.6.. 14 iv

4.1.............................. 16 v

1,,, [1].,.,,.., Web, [6].,.,, [2].,.. 1, 2.. 1.1 Command. 1

1.2. 1.2 Command A Command B Receiver Command ConcreteCommand Receiver. 1.2 Command [1]...., 1.2 Command. Command. ConcreteCommand Receiver Command Command A Command B Receiver. Command,,.,,..,. 2

1.1 Command 1.2 1.3,,., 1.3. 2, Tsantalis [2]. 3. 4, 5. 5,. 3

2, Tsantaris [2]. 2.1 [2],,..,., [2] 1.1 Command 2.1. Command ConcreteCommand Receiver.,,. {X ij i j. 2.2 [2]. similarity scoring algorithm. Kleinberg [3], Web Blondel [4] 4

2.2 2.1 Command, 2.. G A, G B n A, n B. S n A n B. S ij G A j G B i, 2 similarity score. S. 1. Z 0 = 1. 2.,. Z k+1 = 3. S Z k. A, B G A G B. BZ ka T + B T Z k A BZ k A T + B T Z k A 1 (2.1) 5

2.3 Z 0 1 n B n A.. 1 1,. G A G B. n B n A.., i i k i [0, 1]., x, S ij x 1 x i j.,. 2.3 [2].,,,,,,,,,., 6

2.3 Observer, Composite, Decorator, Composite Adapter Command Template Method Factory Method private, static, Singleton Visitor [2]. 1,. 7

3,. 3.1,.., 1 1.2 Command 1.1. [2] Command, Command : 1 Command 2, 2 Command ConcreteCommand Receiver, Command. 1.2 2, 1, ConcreteCommand Receiver Invoker. 2 8

3.2,..,.. 1. [2].. 2.. 3.. 4. 1 3, 3.2. 4 2.2. 3.2 [1] 23 Command, Adapter, Factory Method, Proxy, Composite 5., 5,. 3.2.1. 9

3.2 generalization. association. instantiation. factory method.. method invocation. invoked method in inherited method. similar method invocation. similar method invocation from sibling subclass. iterative similar method invocation. iterative similar abstract method invocation 10

3.2., [2] factory method,,. 3.2.2. 3.2.2,.,.., 3.1,, 3.2 factory method, factory method, 11

3.2 3.1 3.3, 3.4,, 3.5,, 3.6 12

3.2 3.2 3.3 factory method 3.4 13

3.2 3.5 3.6 14

4 [1] 23, Command, Adapter, Factory Method, Proxy, Composite 5, [7][9].,... 1.,.,. 2., 3.2,. 3.., Command, Adapter, Factory Method, Proxy, Composite 5. [2].. 15

\ Command Adapter Factory Method Proxy Composite Adapter/Command TP TP TN FP TN Factory Method TN TN TP TN TN Proxy TN TN TN TP TN Composite TN TN TN TN TP 4.1 True-Positive TP :,. True-Negative TN :,. False-Positive FP :,. False-Negative FN :,. 4.1. 4.1, Adapter Command., [2]. Proxy, Adapter/Command.,.,. 16

5,.,, [2]., [7][9],,..,,.,..,.,,,.,.,.,. 17

.,,,..,,,..,..,,. 18

[1] E. Gamma, R. Helm, R. Johnson, and J. Vlissides,,,,, 1999. [2] N. Tsantalis, A. Chatzigeorgiou, G. Stephanides, and S. Halkidis, Design Pattern Detection Using Similarity Scoring, IEEE Transaction on Software Engineering, vol.32, no.11, pp.896 909, 2006. [3] J.M. Kleinberg, Authoritative Sources in a Hyperlinked Environment, Journal of the ACM, vol.46, no.5, pp.604 632, 1999. [4] V.D. Blondel, A. Gajardo, M. Heymans, P. Senellart, and P. VanDooren, A Measure of Similarity between Graph Vertices: Applications to Synonym Extraction and Web Searching, SIAM Review, vol.46, no.4, pp.647 666, 2004. [5],,, FIT2010 9, pp.289 290, 2010. [6],,,,,, vol.25, no.2, pp.114 134, 2008. [7] Huston Design Patterns, http://www.vincehuston.org/dp/, 2011. [8] Design Pattern detection using Similarity Scoring, http://java.uom.gr/ nikos/pattern-detection.html, 2011. [9], Java,, 2002. 19

A 4,,. Java. A.1 Command Huston design pattern Java demos [8]. class Fan { public void startrotate() { System.out.println("Fan is rotating"); public void stoprotate() { System.out.println("Fan is not rotating"); 20

A.2 Adapter class FanOnCommand { private Fan myfan; public FanOnCommand ( Fan F) { myfan = F; public void execute( ) { myfan. startrotate( ); class FanOffCommand { private Fan myfan; public FanOffCommand ( Fan F) { myfan = F; public void execute( ) { myfan. stoprotate( ); A.2 Adapter Huston Design Pattern [7] Adapter Example. 21

A.2 Adapter class LegacyLine { public void draw( int x1, int y1, int x2, int y2 ) { System.out.println( "line from (" + x1 +, + y1 + ") to (" + x2 +, + y2 + ) ); class LegacyRectangle { public void draw( int x, int y, int w, int h ) { System.out.println( "rectangle at (" + x +, + y + ") with width " + w + " and height " + h ); class Line { private LegacyLine adaptee = new LegacyLine(); public void draw( int x1, int y1, int x2, int y2 ) { adaptee.draw( x1, y1, x2, y2 ); class Rectangle { private LegacyRectangle adaptee = new LegacyRectangle(); public void draw( int x1, int y1, int x2, int y2 ) { adaptee.draw( Math.min(x1,x2), Math.min(y1,y2), Math.abs(x2-x1), Math.abs(y2-y1) ); 22

A.3 Factory Method A.3 Factory Method Huston design pattern Java demos [8]. interface Product { public String getname(); class ConcreteProductA implements Product{ public String getname() { return "ProductA"; class ConcreteProductB implements Product { public String getname() { return "ProductB"; 23

A.4 Proxy class ConcreteCreatorA { public Product factorymethod() { return new ConcreteProductA(); class ConcreteCreatorB { public Product factorymethod() { return new ConcreteProductB(); A.4 Proxy Java [9, pp.323 335]. class Printer { private String name; public Printer() { heavyjob("printer "); public Printer(String name) { // this.name = name; heavyjob("printer (" + name + ") "); 24

A.4 Proxy public void setprintername(string name) { // this.name = name; public String getprintername() { // return name; public void print(string string) { // System.out.println("=== " + name + " ==="); System.out.println(string); private void heavyjob(string msg) { // ( ) System.out.print(msg); for (int i = 0; i < 5; i++) { try { Thread.sleep(1000); catch (InterruptedException e) { System.out.print("."); System.out.println(" "); class PrinterProxy { private String name; // 25

A.4 Proxy private Printer real; // public PrinterProxy() { public PrinterProxy(String name) { // this.name = name; public synchronized void setprintername(string name) { // if (real!= null) { real.setprintername(name); // this.name = name; public String getprintername() { // return name; public void print(string string) { // realize(); real.print(string); private synchronized void realize() { // if (real == null) { real = new Printer(name); 26

A.5 Composite A.5 Composite Java [9, pp.153 167]. import java.util.iterator; import java.util.arraylist; class File { private String name; private int size; public File(String name, int size) { this.name = name; this.size = size; public String getname() { return name; public int getsize() { return size; class Directory { private String name; // 27

A.5 Composite private ArrayList directory = new ArrayList(); // private ArrayList file = new ArrayList(); public Directory(String name) { // this.name = name; public String getname() { // return name; public int getsize() { // int size = 0; Iterator itfile = file.iterator(); Iterator itdir = directory.iterator(); while (itdir.hasnext()) { Directory direntry = (Directory)itDir.next(); size += direntry.getsize(); while (itfile.hasnext()) { File fileentry = (File)itFile.next(); size += fileentry.getsize(); return size; public Directory adddirectory(directory entry) { // directory.add(entry); 28

A.5 Composite return this; public Directory addfile(file entry) { // file.add(entry); return this; 29