automatic code completion exploting semantic similarity

Post on 17-Jun-2015

98 Views

Category:

Education

3 Downloads

Preview:

Click to see full reader

DESCRIPTION

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

TRANSCRIPT

Automatic Code Completion Using Semantic Similarity

Mohammad Masudur Rahman (NSID: MOR543)

Presenter :

A Proposal for CMPT 880 Research Project

Research Methods & Topics

2

Contents

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

3

Automatic Code Completion

Fig: Developer types a character

4

Automatic Code Completion

Fig: List of suggestions

5

Automatic Code Completion

Fig: IDE completes the word

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

7

API Usage Pattern

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

8

API Usage Pattern

Fig: Code under editing

9

Motivating Example

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

10

Motivating Example (Semantic Model)

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

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.

12

Experimental Design

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

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

15

Evaluation Plan

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

Comparing with existing methods Usability Testing Integration into IDE

16

Evaluation Metrics

made

relevantmade

tionrecommenda

tionrecommendationrecommendaprecision

relevant

maderelevant

tionrecommenda

tionrecommendationrecommendarecall

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

recallprecision

recallprecisionscoref

2

17

Expected Results & Interpretation

18

Semantic Features in Pattern Matching

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

19

Context Capture from Semantic Model

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

20

Summary

API usage pattern based code completion

Semantic Model better for OOP relationship representation

Semantic Similarity between API usage pattern and editing code

21

Thank You !!!

Please ask your questions

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

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

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

top related