ABSTRACT
Programmers commonly reuse existing frameworks or libraries to reduce software development efforts. One common problem in reusing the existing frameworks or libraries is that the programmers know what type of object that they need, but do not know how to get that object with a specific method sequence. To help programmers to address this issue, we have developed an approach that takes queries of the form "Source object type → Destination object type" as input, and suggests relevant method-invocation sequences that can serve as solutions that yield the destination object from the source object given in the query. Our approach interacts with a code search engine (CSE) to gather relevant code samples and performs static analysis over the gathered samples to extract required sequences. As code samples are collected on demand through CSE, our approach is not limited to queries of any specific set of frameworks or libraries. We have implemented our approach with a tool called PARSEWeb, and conducted four different evaluations to show that our approach is effective in addressing programmer's queries. We also show that PARSEWeb performs better than existing related tools: Prospector and Strathcona
- J. Anjou, S. Fairbrother, D. Kehn, J. Kellerman, and P. McCarthy. The Java Developer's Guide to Eclipse. Addison-Wesley Professional, 2004. Google ScholarDigital Library
- S. Bajracharya, T. Ngo, E. Linstead, Y. Dou, P. Rigor, P. Baldi, and C. Lopes. Sourcerer: A search engine for open source code supporting structure based search. In Proc. of OOPSLA Companion, 2006. Google ScholarDigital Library
- Jakarta BCEL user forum, 2001. http://mail-archives.apache.org/mod_mbox/jakarta-bcel-user/200609.mbox/thread.Google Scholar
- Dev2Dev Newsgroups by developers, for developers, 2006. http://forums.bea.com/bea/message.jspa? messageID=202265042&tstart=0.Google Scholar
- Google Code Search Engine, 2006. http://www.google.com/codesearch.Google Scholar
- R. Holmes and G. Murphy. Using structural context to recommend source code examples. In Proc. of ICSE, pages 117--125, 2005. Google ScholarDigital Library
- Jung the Java Universal Network/Graph Framework, 2005. http://jung.sourceforge.net/.Google Scholar
- The Koders source code search engine, 2005. http://www.koders.com.Google Scholar
- T. Lethbridge, J. Singer, and A. Forward. How software engineers use documentation: The state of the practice. In IEEE Software, pages 35--39, 2003. Google ScholarDigital Library
- Logic Project based on Eclipse GEF, 2006. http://www.eclipse.org/downloads/download.php? file=/tools/gef/downloads/drops/R-3.2.1-&200609211617/GEF-examples-3.2.1.zip.Google Scholar
- D. Mandelin, L. Xu, R. Bodik, and D. Kimelman. Jungloid mining: helping to navigate the API jungle. In Proc. of PLDI, pages 48--61, 2005. Google ScholarDigital Library
- Y. Matsumoto. A Software Factory: An Overall Approach to Software Production. In P. Freeman ed., Software Reusability. IEEE CS Press, 1987.Google Scholar
- T. Sager, A. Bernstein, M. Pinzger, and C. Kiefer. Detecting similar Java classes using tree algorithms. In Proc. of MSR, pages 65--71, 2006. Google ScholarDigital Library
- N. Sahavechaphan and K. Claypool. XSnippet: Mining for sample code. In Proc. of OOPSLA, pages 413--430, 2006. Google ScholarDigital Library
- T. Xie and J. Pei. MAPO: Mining API usages from open source repositories. In Proc. of MSR, pages 54--57, 2006. Google ScholarDigital Library
- Y. Ye and G. Fischer. Supporting reuse by delivering taskrelevant and personalized information. In Proc. of ICSE, pages 513--523, 2002. Google ScholarDigital Library
Index Terms
- Parseweb: a programmer assistant for reusing open source code on the web
Recommendations
Exploiting code search engines to improve programmer productivity
OOPSLA '07: Companion to the 22nd ACM SIGPLAN conference on Object-oriented programming systems and applications companionCode Search Engines (CSE) can serve as powerful resources of open source code, as they can search in billions of lines of open source code available on the web. The strength of CSEs can be used for several tasks like searching relevant code samples, ...
Typestate-based semantic code search over partial programs
OOPSLA '12We present a novel code search approach for answering queries focused on API-usage with code showing how the API should be used. To construct a search index, we develop new techniques for statically mining and consolidating temporal API specifications ...
XSnippet: mining For sample code
Proceedings of the 2006 OOPSLA ConferenceIt is common practice for software developers to use examples to guide development efforts. This largely unwritten, yet standard, practice of "develop by example" is often supported by examples bundled with library or framework packages, provided in ...
Comments