skip to main content
article
Public Access

DemoMatch: API discovery from demonstrations

Published:14 June 2017Publication History
Skip Abstract Section

Abstract

We introduce DemoMatch, a tool for API discovery that allows the user to discover how to implement functionality using a software framework by demonstrating the functionality in existing applications built with the same framework. DemoMatch matches the demonstrations against a database of execution traces called Semeru and generates code snippets explaining how to use the functionality. We evaluated DemoMatch on several case studies involving Java Swing and Eclipse RCP.

References

  1. Eclipse Mars Newsletter. https://www.eclipse. org/community/eclipse_newsletter/2015/july/ article1.php.Google ScholarGoogle Scholar
  2. Apache lucene. https://lucene.apache.org/.Google ScholarGoogle Scholar
  3. Swing Tutorial. http://docs.oracle.com/javase/ tutorial/uiswing/.Google ScholarGoogle Scholar
  4. E. Bruneton, R. Lenglet, and T. Coupaye. Asm: a code manipulation tool to implement adaptable systems. Adaptable and extensible component systems, 30(19), 2002.Google ScholarGoogle Scholar
  5. R. P. L. Buse and W. Weimer. Synthesizing api usage examples. In Proceedings of the 34th International Conference on Software Engineering, ICSE ’12, pages 782–792, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. T. Eisenbarth, R. Koschke, and D. Simon. Locating features in source code. Software Engineering, IEEE Transactions on, 29(3):210–224, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. J. Galenson, P. Reames, R. Bodik, B. Hartmann, and K. Sen. Codehint: Dynamic and interactive synthesis of code snippets. In Proceedings of the 36th International Conference on Software Engineering, ICSE 2014, pages 653–663, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. S. F. Goldsmith, R. O’Callahan, and A. Aiken. Relational queries over program traces. In Proceedings of the 20th Annual ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications, OOPSLA ’05, pages 385–402, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. S. Gulwani, W. R. Harris, and R. Singh. Spreadsheet data manipulation using examples. Commun. ACM, 55(8):97–105, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Z. Guo, X. Wang, J. Tang, X. Liu, Z. Xu, M. Wu, M. F. Kaashoek, and Z. Zhang. R2: An application-level kernel for record and replay. In Proceedings of the 8th USENIX Conference on Operating Systems Design and Implementation, OSDI’08, pages 193–208, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. T. Gvero, V. Kuncak, I. Kuraj, and R. Piskac. Complete completion using types and weights. In Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’13, pages 27–38, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. A. Heydarnoori, K. Czarnecki, and T. T. Bartolomei. Supporting framework use via automatically extracted concept-implementation templates. In S. Drossopoulou, editor, ECOOP 2009 – Object-Oriented Programming: 23rd European Conference, Genoa, Italy, July 6-10, 2009. Proceedings, pages 344–368, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. R. Holmes and G. C. Murphy. Using structural context to recommend source code examples. In Proceedings. 27th International Conference on Software Engineering, 2005. ICSE 2005., pages 117–125, May 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. O. Katz, R. El-Yaniv, and E. Yahav. Estimating types in binaries using predictive modeling. In Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’16, pages 313–326, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. V. Le, S. Gulwani, and Z. Su. Smartsynth: Synthesizing smartphone automation scripts from natural language. In Proceeding of the 11th Annual International Conference on Mobile Systems, Applications, and Services, MobiSys ’13, pages 193–206, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. G. Little and R. C. Miller. Keyword programming in java. In Proceedings of the Twenty-second IEEE/ACM International Conference on Automated Software Engineering, ASE ’07, pages 84–93, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. D. Mandelin, L. Xu, R. Bodík, and D. Kimelman. Jungloid mining: Helping to navigate the api jungle. In Proceedings of the 2005 ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’05, pages 48–61, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. M. Martin, B. Livshits, and M. S. Lam. Finding application errors and security flaws using pql: A program query language. In Proceedings of the 20th Annual ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications, OOPSLA ’05, pages 365–383, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. M. Mayer and V. Kuncak. Game programming by demonstration. In Proceedings of the 2013 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming & Software, Onward! 2013, pages 75–90, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. C. McMillan, M. Grechanik, D. Poshyvanyk, Q. Xie, and C. Fu. Portfolio: Finding relevant functions and their usage. In Proceedings of the 33rd International Conference on Software Engineering, ICSE ’11, pages 111–120, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. A. Mishne, S. Shoham, and E. Yahav. Typestate-based semantic code search over partial programs. In Proceedings of the ACM International Conference on Object Oriented Programming Systems Languages and Applications, OOPSLA ’12, pages 997–1016, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. N. Nitta, I. Kume, and Y. Takemura. Identifying mandatory code for framework use via a single application trace. In R. Jones, editor, ECOOP 2014 – Object-Oriented Programming: 28th European Conference, Uppsala, Sweden, July 28 – August 1, 2014. Proceedings, pages 593–617. 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. H. Peleg, S. Shoham, E. Yahav, and H. Yang. Symbolic automata for static specification mining. In F. Logozzo and M. Fähndrich, editors, Static Analysis: 20th International Symposium, SAS 2013, Seattle, WA, USA, June 20-22, 2013. Proceedings, pages 63–83. 2013.Google ScholarGoogle Scholar
  24. D. Perelman, S. Gulwani, T. Ball, and D. Grossman. Typedirected completion of partial expressions. In Proceedings of the 33rd ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’12, pages 275–286, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. V. Raychev, M. Vechev, and E. Yahav. Code completion with statistical language models. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’14, pages 419–428, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. V. Raychev, M. Vechev, and A. Krause. Predicting program properties from "big code". In Proceedings of the 42Nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’15, pages 111–124, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. S. P. Reiss. Semantics-based code search. In Proceedings of the 31st International Conference on Software Engineering, ICSE ’09, pages 243–253, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. N. Sahavechaphan and K. Claypool. Xsnippet: Mining for sample code. In Proceedings of the 21st Annual ACM SIGPLAN Conference on Object-oriented Programming Systems, Languages, and Applications, OOPSLA ’06, pages 413–430, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. G. Salton and C.-S. Yang. On the specification of term values in automatic indexing. Journal of documentation, 29(4):351–372, 1973.Google ScholarGoogle ScholarCross RefCross Ref
  30. M. Sridharan, S. J. Fink, and R. Bodik. Thin slicing. In Proceedings of the 28th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’07, pages 112–122, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. N. Technology. The neo4j manual v2.0.0-m02. May 2013.Google ScholarGoogle Scholar
  32. S. Thummalapenta and T. Xie. Parseweb: A programmer assistant for reusing open source code on the web. In Proceedings of the Twenty-second IEEE/ACM International Conference on Automated Software Engineering, ASE ’07, pages 204–213, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. J. Wang, Y. Dang, H. Zhang, K. Chen, T. Xie, and D. Zhang. Mining succinct and high-coverage api usage patterns from source code. In Proceedings of the 10th Working Conference on Mining Software Repositories, MSR ’13, pages 319–328, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. N. Wilde and M. C. Scully. Software reconnaissance: mapping program features to code. Journal of Software Maintenance: Research and Practice, 7(1):49–62, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. M. Wu, F. Long, X. Wang, Z. Xu, H. Lin, X. Liu, Z. Guo, H. Guo, L. Zhou, and Z. Zhang. Language-based replay via data flow cut. In Proceedings of the Eighteenth ACM SIGSOFT International Symposium on Foundations of Software Engineering, FSE ’10, pages 197–206, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. K. Yessenov. Program Synthesis from Execution Traces and Demonstrations. PhD thesis, Massachusetts Institute of Technology, 2016.Google ScholarGoogle Scholar
  37. K. Yessenov, Z. Xu, and A. Solar-Lezama. Data-driven synthesis for object-oriented frameworks. In Proceedings of the 2011 ACM international conference on Object oriented programming systems languages and applications, OOPSLA ’11, pages 65–82, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. K. Yessenov, S. Tulsiani, A. Menon, R. C. Miller, S. Gulwani, B. Lampson, and A. Kalai. A colorful approach to text processing by example. In Proceedings of the 26th Annual ACM Symposium on User Interface Software and Technology, UIST ’13, pages 495–504, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. H. Zhong, T. Xie, L. Zhang, J. Pei, and H. Mei. Mapo: Mining and recommending api usage patterns. In Proceedings of the 23rd European Conference on ECOOP 2009 — Object-Oriented Programming, Genoa, pages 318–343. 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. DemoMatch: API discovery from demonstrations

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Published in

          cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 52, Issue 6
          PLDI '17
          June 2017
          708 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/3140587
          Issue’s Table of Contents
          • cover image ACM Conferences
            PLDI 2017: Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation
            June 2017
            708 pages
            ISBN:9781450349888
            DOI:10.1145/3062341

          Copyright © 2017 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 14 June 2017

          Check for updates

          Qualifiers

          • article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!