automatic code completion exploting semantic similarity

24
Automatic Code Completion Using Semantic Similarity Mohammad Masudur Rahman (NSID: MOR543) Presente r : A Proposal for CMPT 880 Research Project Research Methods & Topics

Upload: masud-rahman

Post on 17-Jun-2015

96 views

Category:

Education


3 download

DESCRIPTION

An optimistic proposal for automatic code completion exploiting semantic similarity among code snippets.

TRANSCRIPT

Page 1: Automatic Code Completion Exploting Semantic Similarity

Automatic Code Completion Using Semantic Similarity

Mohammad Masudur Rahman (NSID: MOR543)

Presenter :

A Proposal for CMPT 880 Research Project

Research Methods & Topics

Page 2: Automatic Code Completion Exploting Semantic Similarity

2

Contents

Automatic Code Completion Motivating Example Thesis Statement Experimental Design Expected Results Summary

Page 3: Automatic Code Completion Exploting Semantic Similarity

3

Automatic Code Completion

Fig: Developer types a character

Page 4: Automatic Code Completion Exploting Semantic Similarity

4

Automatic Code Completion

Fig: List of suggestions

Page 5: Automatic Code Completion Exploting Semantic Similarity

5

Automatic Code Completion

Fig: IDE completes the word

Page 6: Automatic Code Completion Exploting Semantic Similarity

6

Automatic Code Completion Automatic coding support from IDE First in IDE by Microsoft in 1996 Intellisense Very common in modern IDEs Also in search engines, email, database

query tools, Unix terminals Features: control structure, loop

structure, event handling support

Page 7: Automatic Code Completion Exploting Semantic Similarity

7

API Usage Pattern

Fig: SWT API usage pattern, Nguyen et al. ICSE’12

Page 8: Automatic Code Completion Exploting Semantic Similarity

8

API Usage Pattern

Fig: Code under editing

Page 9: Automatic Code Completion Exploting Semantic Similarity

9

Motivating Example

Fig: Graph representation of API usage pattern, Nguyen et al, ICSE’12

Page 10: Automatic Code Completion Exploting Semantic Similarity

10

Motivating Example (Semantic Model)

Fig: Semantic representation of API usage pattern, Wursch et al., ICSE’10

Page 11: Automatic Code Completion Exploting Semantic Similarity

11

Thesis Statement

An approach that considers semantic similarity such as conceptual or functional similarity and code context between API usage patterns and current code under editing, can improve the automatic code completion in terms of accuracy.

Page 12: Automatic Code Completion Exploting Semantic Similarity

12

Experimental Design

Page 13: Automatic Code Completion Exploting Semantic Similarity

13

API Usage Pattern Extraction, Nguyen et al, ICSE’12

FAMIX Model, Wursch et al., ICSE’10

Semantic Model, Wursch et al., ICSE’10

Semantic Query Binary Feature Matrix, Bruch et al, FSE’09

K Nearest Neighbors, Bruch et al, FSE’09

Ranked Patterns

Experimental Design

Page 14: Automatic Code Completion Exploting Semantic Similarity

14

Experimental Design

Fig: Overall System architecture

Existing Code base Methods API Usage Patterns FAMIX

Semantic ModelQuery Engine

Code Query

Semantic Query

Binary Feature Matrix

KNN Patterns Ranked Suggestions

Page 15: Automatic Code Completion Exploting Semantic Similarity

15

Evaluation Plan

Performance Evaluation Precision, Recall, F-Score, Bruch et al, FSE’09

Comparing with existing methods Usability Testing Integration into IDE

Page 16: Automatic Code Completion Exploting Semantic Similarity

16

Evaluation Metrics

made

relevantmade

tionrecommenda

tionrecommendationrecommendaprecision

relevant

maderelevant

tionrecommenda

tionrecommendationrecommendarecall

Precision, Recall, F-Score, Bruch et al. FSE’09

recallprecision

recallprecisionscoref

2

Page 17: Automatic Code Completion Exploting Semantic Similarity

17

Expected Results & Interpretation

Page 18: Automatic Code Completion Exploting Semantic Similarity

18

Semantic Features in Pattern Matching

Fig: Semantic representation vs. Graph representation, Nguyen et al, ICSE’12

Page 19: Automatic Code Completion Exploting Semantic Similarity

19

Context Capture from Semantic Model

Fig: Detailed context in Semantic model, SPARQL [12]

Page 20: Automatic Code Completion Exploting Semantic Similarity

20

Summary

API usage pattern based code completion

Semantic Model better for OOP relationship representation

Semantic Similarity between API usage pattern and editing code

Page 21: Automatic Code Completion Exploting Semantic Similarity

21

Thank You !!!

Please ask your questions

Page 22: Automatic Code Completion Exploting Semantic Similarity

22

Bibliography[1]. Marcel Bruch, Martin Monperrus, and Mira Mezini. 2009. Learning from

examples to improve code completion systems. In Proceedings of the the 7th joint meeting of the European software engineering conference and the ACM SIGSOFT symposium on The foundations of software engineering (ESEC/FSE '09). ACM, New York, NY, USA, 213-222

[2] T. R. Dean, J. R. Cordy, A. J. Malton, and K. A. Schneider. Agile parsing in TXL. Automated Software Engg.,10(4):311{336,Oct.2003.ISSN 0928-8910.

[3] Sangmok Han, Wallace, D.R., Miller, R.C., Code Completion from Abbreviated Input. Automated Software Engineering, 2009. ASE '09. 24th IEEE/ACM International Conference on , vol., no., pp.332-343, 16-20 Nov. 2009

[4] Daqing Hou and Pletcher, D.M. An evaluation of the strategies of sorting, filtering, and grouping API methods for Code Completion. Software Maintenance (ICSM), 2011 27th IEEE International Conference on , vol., no., pp.233-242, 25-30 Sept. 2011

[5] Daqing Hou and David M. Pletcher. 2010. Towards a better code completion system by API grouping, filtering, and popularity-based ranking. In Proceedings of the 2nd International Workshop on Recommendation Systems for Software Engineering (RSSE '10). ACM, New York, USA

Page 23: Automatic Code Completion Exploting Semantic Similarity

23

Bibliography[6] Nguyen, A.T., Nguyen, T.T., Nguyen, H.A., Tamrawi, A., Nguyen, H.V., Al-

Kofahi J. and Nguyen, T.N. Graph-based pattern-oriented, context-sensitive source code completion. Software Engineering (ICSE), 2012 34th International Conference on , vol., no., pp.69-79, 2-9 June 2012

[7] Omar, C, Yoon, Y.S., LaToza, T.D., Myers, B.A.. Active code completion. Software Engineering (ICSE), 2012 34th International Conference on , vol., no., pp.859-869, 2-9 June 2012

[8] S. Tichelaar, S. Ducasse, and S. Demeyer. FAMIX and XMI. In Reverse Engineering,2000.Proceedings.Seventh Working Conference on pages 296-298,2000.

[9] Wursch, M., Ghezzi, G., Reif, G., and Gall, H.C. Supporting developers with natural language queries. Software Engineering, 2010 ACM/IEEE 32nd International Conference on , vol.1, no., pp.165-174, 2-8 May 2010

[10] Semantic web development tools, URL: http://www.w3.org/2001/sw/wiki/Tools

Page 24: Automatic Code Completion Exploting Semantic Similarity

24

Bibliography

[11] Intellisense, URL: http://en.wikipedia.org/wiki/IntelliSense[12] SPARQL Query Tools, URL: http://www.w3.org/2001/sw/wiki/SPARQL[13] Semantic Model vs. Conceptual Model, URL:

http://en.wikipedia.org/wiki/Semantic_model\#Data_models