The document proposes using semantic similarity between API usage patterns and code under editing to improve automatic code completion. It discusses extracting API usage patterns and representing them and code in a semantic model. An experimental design is presented that would use semantic queries to find similar patterns for code completion suggestions, evaluated based on precision, recall and F-score. The expected results are that using semantic features rather than just syntax would provide more accurate and context-aware suggestions.
1. Research Methods & Topics
Automatic Code
Completion Using
Semantic Similarity
A Proposal for CMPT 880 Research Project
Presenter : Mohammad Masudur Rahman
(NSID: MOR543)
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
6
10. Motivating Example (Semantic Model)
Fig: Semantic representation of API usage pattern,
Wursch et al., ICSE’10
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.
11
18. Semantic Features in Pattern Matching
Fig: Semantic representation vs. Graph representation, Nguyen et
al, ICSE’12
18
19. Context Capture from Semantic Model
Fig: Detailed context in Semantic model, SPARQL [12]
19
20. Summary
API usage pattern based code
completion
Semantic Model better for OOP
relationship representation
Semantic Similarity between API usage
pattern and editing code
20
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
[2]
[3]
[4]
[5]
'09). ACM, New York, NY, USA, 213-222
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.
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
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
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
22
23. Bibliography
[6]
[7]
[8]
[9]
[10]
Nguyen, A.T., Nguyen, T.T., Nguyen, H.A., Tamrawi, A., Nguyen, H.V., AlKofahi 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
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
S. Tichelaar, S. Ducasse, and S. Demeyer. FAMIX and XMI. In Reverse
Engineering,2000.Proceedings.Seventh Working Conference on pages 296298,2000.
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
Semantic web development tools, URL: http://www.w3.org/2001/sw/wiki/Tools
23