Keyword programming in Java

Article

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.

Keywords

Java Autocomplete Code assistants 

References

  1. Fellbaum, C. (ed.): WordNet: An Electronic Lexical Database. MIT Press, Cambridge (1998) MATHGoogle Scholar
  2. Hill, R., Rideoutm, J.: Automatic method completion. In: Proceedings of Automated Software Engineering (ASE 2004), pp. 228–235 (2004) Google Scholar
  3. 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) Google Scholar
  4. Little, G., Miller, R.C.: Translating keyword commands into executable code. In: Proceedings of User Interface Software & Technology (UIST 2006), pp. 135–144 (2006) Google Scholar
  5. 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) Google Scholar
  6. 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) Google Scholar
  7. Prieto-Diaz, R., Freeman, P.: Classifying software for reusability. IEEE Softw. 4(1), 6–16 (1987) CrossRefGoogle Scholar
  8. Rittri, M.: Retrieving library identifiers via equational matching of types. In: Proceedings of the Tenth International Conference on Automated Deduction, pp. 603–617 (1990) Google Scholar
  9. 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) Google Scholar
  10. 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 Google Scholar
  11. 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 Google Scholar
  12. 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 Google Scholar
  13. Zaremski, A.M., Wing, J.M.: Signature matching: a tool for using software libraries. ACM Trans. Softw. Eng. Methodol. 4(2), 146–170 (1995) CrossRefGoogle Scholar
  14. Zaremski, A.M., Wing, J.M.: Specification matching of software components. ACM Trans. Softw. Eng. Methodol. 6(4), 333–369 (1997) CrossRefGoogle Scholar

Copyright information

© Springer Science+Business Media, LLC 2008

Authors and Affiliations

  1. 1.MIT CSAILCambridgeUSA

Personalised recommendations