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.
- Eclipse Mars Newsletter. https://www.eclipse. org/community/eclipse_newsletter/2015/july/ article1.php.Google Scholar
- Apache lucene. https://lucene.apache.org/.Google Scholar
- Swing Tutorial. http://docs.oracle.com/javase/ tutorial/uiswing/.Google Scholar
- 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 Scholar
- 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 Scholar
Digital Library
- T. Eisenbarth, R. Koschke, and D. Simon. Locating features in source code. Software Engineering, IEEE Transactions on, 29(3):210–224, 2003. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- S. Gulwani, W. R. Harris, and R. Singh. Spreadsheet data manipulation using examples. Commun. ACM, 55(8):97–105, 2012. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- S. P. Reiss. Semantics-based code search. In Proceedings of the 31st International Conference on Software Engineering, ICSE ’09, pages 243–253, 2009. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- G. Salton and C.-S. Yang. On the specification of term values in automatic indexing. Journal of documentation, 29(4):351–372, 1973.Google Scholar
Cross Ref
- 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 Scholar
Digital Library
- N. Technology. The neo4j manual v2.0.0-m02. May 2013.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- K. Yessenov. Program Synthesis from Execution Traces and Demonstrations. PhD thesis, Massachusetts Institute of Technology, 2016.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
Index Terms
DemoMatch: API discovery from demonstrations
Recommendations
DemoMatch: API discovery from demonstrations
PLDI 2017: Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and ImplementationWe 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 ...
Eclipse API usage: the good and the bad
Today, when constructing software systems, many developers build their systems on top of frameworks. Eclipse is such a framework that has been in existence for over a decade. Like many other evolving software systems, the Eclipse platform has both ...






Comments