Abstract
We present a new code assistance tool for integrated development environments. Our system accepts as input free-form queries containing a mixture of English and Java, and produces Java code expressions that take the query into account and respect syntax, types, and scoping rules of Java, as well as statistical usage patterns. In contrast to solutions based on code search, the results returned by our tool need not directly correspond to any previously seen code fragment. As part of our system we have constructed a probabilistic context free grammar for Java constructs and library invocations, as well as an algorithm that uses a customized natural language processing tool chain to extract information from free-form text queries. We present the results on a number of examples showing that our technique (1) often produces the expected code fragments, (2) tolerates much of the flexibility of natural language, and (3) can repair incorrect Java expressions that use, for example, the wrong syntax or missing arguments.
- M. Allamanis and S. Charles. Mining Source Code Repositories at Massive Scale using Language Modeling. In Conf. Mining Software Repositories. IEEE, 2013. Google Scholar
Digital Library
- AnyCode Source Code. https: //github.com/tihomirg/nlpcoder/tree/noola, 2015.Google Scholar
- BitBucket. BitBucket repository hosting service, https://bitbucket.org/, 2015.Google Scholar
- M. Bruch, M. Monperrus, and M. Mezini. Learning from examples to improve code completion systems. In ESEC/SIGSOFT FSE, pages 213–222, 2009. Google Scholar
Digital Library
- R. Burkard, M. Dell’Amico, and S. Martello. Assignment Problems. Society for Industrial and Applied Math., 2009. Google Scholar
Digital Library
- S. Chatterjee, S. Juvekar, and K. Sen. SNIFF: A search engine for java using free-form queries. In FASE, pages 385–400, 2009. Google Scholar
Digital Library
- A. Cozzie and S. T. King. Macho: Writing programs with natural language and examples. Technical report, University of Illinois at Urbana-Champaign, 2012.Google Scholar
- M.-C. de Marneffe, B. MacCartney, and C. D. Manning. Generating typed dependency parses from phrase structure parses. In LREC, pages 449–454, 2006.Google Scholar
- Eclipse Code Recommenders. http://www.eclipse.org/recommenders/, 2015.Google Scholar
- EclipseJDT. EclipseJDT, http://www.eclipse.org/jdt/, 2015.Google Scholar
- C. Fellbaum. WordNet: An Electronic Lexical Database. Bradford Books, 1998.Google Scholar
Cross Ref
- J. Galenson, P. Reames, R. Bod´ık, B. Hartmann, and K. Sen. Codehint: Dynamic and interactive synthesis of code snippets. In ICSE, pages 653–663, 2014. Google Scholar
Digital Library
- GitHub. GitHub repository hosting service, https://github.com/, 2015.Google Scholar
- T. Gvero and V. Kuncak. Interactive synthesis using free-form queries. In International Conference on Software Engineering, Demo Papers (ICSE Demo), 2015. Google Scholar
Digital Library
- T. Gvero, V. Kuncak, and R. Piskac. Interactive synthesis of code snippets. In Computer Aided Verification (CAV) Tool Demo, 2011. Google Scholar
Digital Library
- T. Gvero, V. Kuncak, I. Kuraj, and R. Piskac. Complete completion using types and weights. In PLDI, pages 27–38, 2013. Google Scholar
Digital Library
- M. Harman, Y. Jia, and W. B. Langdon. Babel pidgin: SBSE can grow and graft entirely new functionality into a real world system. In SSBSE Challenge Track, 2014.Google Scholar
Cross Ref
- R. Holmes and G. C. Murphy. Using structural context to recommend source code examples. In ICSE, 2005. Google Scholar
Digital Library
- D. Jurafsky and J. H. Martin. Speech and Language Processing. Prentice Hall, 2 edition, 2008. Google Scholar
Digital Library
- H. W. Kuhn. The Hungarian method for the assignment problem. Naval Research Logistics Quart., 2:83–97, 1955.Google Scholar
Cross Ref
- V. Le, S. Gulwani, and Z. Su. Smartsynth: Synthesizing smartphone automation scripts from natural language. In MobiSys, 2013. Google Scholar
Digital Library
- G. Little and R. C. Miller. Keyword programming in Java. In ASE, pages 84–93, 2007. Google Scholar
Digital Library
- H. Liu and H. Lieberman. Metafor: Visualizing stories as code. In IUI, pages 305–307, 2005. Google Scholar
Digital Library
- C. D. Manning, M. Surdeanu, J. Bauer, J. Finkel, S. J. Bethard, and D. McClosky. The Stanford CoreNLP natural language processing toolkit. In ACL, pages 55–60, 2014.Google Scholar
Cross Ref
- A. Mishne, S. Shoham, and E. Yahav. Typestate-based semantic code search over partial programs. In OOPSLA, pages 997–1016, 2012. Google Scholar
Digital Library
- D. Price, E. Riloff, J. L. Zachary, and B. Harvey. NaturalJava: A natural language interface for programming in Java. In IUI, pages 207–211, 2000. Google Scholar
Digital Library
- V. Raychev, M. T. Vechev, and E. Yahav. Code completion with statistical language models. In PLDI, page 44, 2014. Google Scholar
Digital Library
- S. P. Reiss. Semantics-based code search. In ICSE, 2009. Google Scholar
Digital Library
- N. Sahavechaphan and K. Claypool. Xsnippet: mining for sample code. In OOPSLA, 2006. Google Scholar
Digital Library
- SourceForge. SourceForge source code repository, http://sourceforge.net/, 2015.Google Scholar
- K. T. Stolee, S. Elbaum, and D. Dobos. Solving the search for source code. ACM TOSEM, 23:26:1–26:45, June 2014. Google Scholar
Digital Library
- S. Thummalapenta and T. Xie. PARSEWeb: a programmer assistant for reusing open source code on the web. In ASE, 2007. Google Scholar
Digital Library
- K. Toutanova, D. Klein, C. D. Manning, and Y. Singer. Feature-rich part-of-speech tagging with a cyclic dependency network. In HLT-NAACL, 2003. Google Scholar
Digital Library
Index Terms
Synthesizing Java expressions from free-form queries
Recommendations
Synthesizing Java expressions from free-form queries
OOPSLA 2015: Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and ApplicationsWe present a new code assistance tool for integrated development environments. Our system accepts as input free-form queries containing a mixture of English and Java, and produces Java code expressions that take the query into account and respect ...
Interactive synthesis using free-form queries
ICSE '15: Proceedings of the 37th International Conference on Software Engineering - Volume 2We present a new code assistance tool for integrated development environments. Our system accepts free-form queries allowing a mixture of English and Java as an input, and produces Java code fragments that take the query into account and respect syntax, ...
Analogical Conception of Chomsky Normal Form and Greibach Normal Form for Linear, Monadic Context-Free Tree Grammars
This paper presents the analogical conception of Chomsky normal form and Greibach normal form for linear, monadic context-free tree grammars (LM-CFTGs). LM-CFTGs generate the same class of languages as four well-known mildly context-sensitive grammars. ...






Comments