Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Automatic Code Completion Exploting Semantic Similarity


Published on

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

Published in: Education, Technology, Business
  • Be the first to comment

  • Be the first to like this

Automatic Code Completion Exploting Semantic Similarity

  1. 1. Research Methods & Topics Automatic Code Completion Using Semantic Similarity A Proposal for CMPT 880 Research Project Presenter : Mohammad Masudur Rahman (NSID: MOR543)
  2. 2. Contents Automatic Code Completion  Motivating Example  Thesis Statement  Experimental Design  Expected Results  Summary  2
  3. 3. Automatic Code Completion Fig: Developer types a character 3
  4. 4. Automatic Code Completion Fig: List of suggestions 4
  5. 5. Automatic Code Completion Fig: IDE completes the word 5
  6. 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
  7. 7. API Usage Pattern Fig: SWT API usage pattern, Nguyen et al. ICSE’12 7
  8. 8. API Usage Pattern Fig: Code under editing 8
  9. 9. Motivating Example Fig: Graph representation of API usage pattern, Nguyen et al, ICSE’12 9
  10. 10. Motivating Example (Semantic Model) Fig: Semantic representation of API usage pattern, Wursch et al., ICSE’10 10
  11. 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
  12. 12. Experimental Design 12
  13. 13. Experimental Design        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 13
  14. 14. Experimental Design Existing Code base Semantic Query Methods API Usage Patterns Query Engine FAMIX Semantic Model Binary Feature Matrix Code Query KNN Patterns Fig: Overall System architecture Ranked Suggestions 14
  15. 15. Evaluation Plan Performance Evaluation  Precision, Recall, F-Score, Bruch et al, FSE’09  Comparing with existing methods  Usability Testing  Integration into IDE  15
  16. 16. Evaluation Metrics recommenda tion made  recommenda tion relevant precision recommenda tion made recall recommenda tion relevant  recommenda tion made recommenda tion relevant f score 2 precision precision recall recall Precision, Recall, F-Score, Bruch et al. FSE’09 16
  17. 17. Expected Results & Interpretation 17
  18. 18. Semantic Features in Pattern Matching Fig: Semantic representation vs. Graph representation, Nguyen et al, ICSE’12 18
  19. 19. Context Capture from Semantic Model Fig: Detailed context in Semantic model, SPARQL [12] 19
  20. 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
  21. 21. Thank You !!! Please ask your questions 21
  22. 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. 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: 23
  24. 24. Bibliography [11] [12] [13] Intellisense, URL: SPARQL Query Tools, URL: Semantic Model vs. Conceptual Model, URL: 24