Abstract
Keyword programming is a novel technique for reducing the need to remember details of programming language syntax and APIs, by translating a small number of unordered keywords provided by the user into a valid expression. In a sense, the keywords act as a query that searches the space of expressions that are valid in the given context. Prior work has demonstrated the feasibility and merit of this approach in limited domains. This paper explores the potential for employing this technique in much larger domains, specifically general-purpose programming languages like Java. We present an algorithm for translating keywords into Java method call expressions. When tested on keywords extracted from existing method calls in Java code, the algorithm can accurately reconstruct over 90% of the original expressions. We tested the algorithm on keywords provided by users in a web-based study. The results suggest that users can obtain correct Java code using keyword queries as accurately as they can write the correct Java code themselves. We implemented the algorithm in an Eclipse plug-in as an extension to the autocomplete mechanism and deployed it in a preliminary field study of several users, with mixed results. One interesting result of this work is that most of the information in Java method call expressions lies in the keywords, and details of punctuation and even parameter ordering can often be inferred automatically.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.References
Fellbaum, C. (ed.): WordNet: An Electronic Lexical Database. MIT Press, Cambridge (1998)
Hill, R., Rideoutm, J.: Automatic method completion. In: Proceedings of Automated Software Engineering (ASE 2004), pp. 228–235 (2004)
Jeng, J.-J., Cheng, B.H.C.: Specification matching for software reuse: a foundation. In: Proceedings of the 1995 Symposium on Software reusability, pp. 97–105 (1995)
Little, G., Miller, R.C.: Translating keyword commands into executable code. In: Proceedings of User Interface Software & Technology (UIST 2006), pp. 135–144 (2006)
Little, G., Lau, T.A., Cypher, A., Lin, J., Haber, E.M., Kandogan, E.: Koala: capture, share, automate, personalize business processes on the Web. In: Proceedings of CHI 2007 (2008, to appear)
Mandelin, D., Xu, L., Bodik, R., Kimelman, D.: Jungloid mining: helping to navigate the API jungle. In: Proceedings of the 2005 ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 48–61 (2005)
Prieto-Diaz, R., Freeman, P.: Classifying software for reusability. IEEE Softw. 4(1), 6–16 (1987)
Rittri, M.: Retrieving library identifiers via equational matching of types. In: Proceedings of the Tenth International Conference on Automated Deduction, pp. 603–617 (1990)
Sahavechaphan, N., Claypool, K.: XSnippet: mining for sample code. In: Proceedings of the 21st Annual ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA 2006), pp. 413–430 (2006)
Tansalarak, N., Claypool, K.T.: Finding a needle in the haystack: a technique for ranking matches between components. In: Proceedings of the 8th International SIGSOFT Symposium on Component-based Software Engineering (CBSE 2005): Software Components at Work, May 2005
Ye, Y., Fischer, G.: Supporting reuse by delivering task-relevant and personalized information. In: Proceedings of the 24th International Conference on Software Engineering (ICSE-02), pp. 513–523, May 2002
Ye, Y., Fischer, G., Reeves, B.: Integrating active information delivery and reuse repository systems. In: International Symposium on Foundations of Software Engineering, pp. 60–68, November 2000
Zaremski, A.M., Wing, J.M.: Signature matching: a tool for using software libraries. ACM Trans. Softw. Eng. Methodol. 4(2), 146–170 (1995)
Zaremski, A.M., Wing, J.M.: Specification matching of software components. ACM Trans. Softw. Eng. Methodol. 6(4), 333–369 (1997)
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Little, G., Miller, R.C. Keyword programming in Java. Autom Softw Eng 16, 37 (2009). https://doi.org/10.1007/s10515-008-0041-9
Received:
Accepted:
Published:
DOI: https://doi.org/10.1007/s10515-008-0041-9