Abstract
It 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 textbooks, and made available for download on both official and unofficial web sites. However, the vast number of examples that are embedded in the billions of lines of already developed library and framework code are largely untapped. We have developed XSnippet, a context-sensitive code assistant framework that allows developers to query a sample repository for code snippets that are relevant to the programming task at hand. In particular, our work makes three primary contributions. First, a range of queries is provided to allow developers to switch between a context-independent retrieval of code snippets to various degrees of context-sensitive retrieval for object instantiation queries. Second, a novel graph-based code mining algorithm is provided to support the range of queries and enable mining within and across method boundaries. Third, an innovative context-sensitive ranking heuristic is provided that has been experimentally proven to provide better ranking for best-fit code snippets than context-independent heuristics such as shortest path and frequency. Our experimental evaluation has shown that XSnippet has significant potential to assist developers, and provides better coverage of tasks and better rankings for best-fit snippets than other code assistant systems.
- V. R. Basili, L. C. Briand, and W. L. Melo. How reuse influences productivity in object-oriented systems. Communications of ACM, 39(10):104--116, 1996. Google ScholarDigital Library
- J. D'Anjou, S. Fairbrother, D. Kehn, J. Kellerman, and P. McCarthy. The Java(TM) Developer's Guide to ECLIPSE (The 2nd Edition). Addison-Wesley Professional, 2004. Google ScholarDigital Library
- O. Drori. Algorithm for Documents Ranking: Idea and Simulation Results. In Proceedings of the 14th international conference on Software Engineering and Knowledge Engineering, pages 99--102. ACM Press New York, NY, USA, 2002. Google ScholarDigital Library
- P. Freeman. Software Reusability. IEEE Computer Society Press, 10662 Los Vaqueros Circle, Los Alamitos, CA 90720 USA, 1987.Google Scholar
- J. Goguen, D. Nguyen, J. Meseguer, Luqi, D. Zhang, and V. Berzins. Software Component Search. Journal of Systems Integration, 6(1/2):93--134, March 1996.Google ScholarCross Ref
- G. T. Heineman and W. T. Councill. Component-based Software Engineering. Addison-Wesley Publishing Company, Reading, Massachusetts, 2001. Google ScholarDigital Library
- R. Hill and J. Rideout. Automatic method completion. In The 16th IEEE International Conference on Automated Software Engineering, pages 228--235, 2004. Google ScholarDigital Library
- R. Holmes and G. C. Murphy. Using structural context to recommend source code examples. In Proceedings of the 27th International Conference on Software Engineering. ACM Press, 2005. Google ScholarDigital Library
- J.-J. Jeng and B. H. C. Cheng. Specification Matching for Software Reuse: A Foundation*. In Proceedings of the 1995 Symposium on Software reusability, pages 97--105. ACM Press, 1995. Google ScholarDigital Library
- G. T. Leavens and M. Sitaraman. Foundations of Component-Based Systems. Cambridge University Press, 2000. Google ScholarDigital Library
- D. Mandelin, L. Xu, R. Bodk, and D. Kimelman. Jungloid mining: helping to navigate the api jungle. In Conference on Programming Language Design and Implementation (PLDI). ACM Press, June 2005. Google ScholarDigital Library
- Y. Matsumoto. A Software Factory: An Overall Approach to Software Production. In P. Freeman, editor, Tutorial: Software Reusability. IEEE Computer Society Press, 1987.Google Scholar
- O. Nierstrasz and T. D. Meijler. Research Directions in Software Composition. ACM Computing Surveys, 27(2):262--264, 1995. Google ScholarDigital Library
- R. Prieto-Diaz and P. Freeman. Classifying Software for Reusability. IEEE Software, 4(1):6--16, 1987.Google ScholarDigital Library
- N. Tansalarak and K. T. Claypool. 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 ScholarDigital Library
- N. Tansalarak and K. T. Claypool. XSnippet: A Code Assistant Framework. Technical Report 2006-xxx, Department of Computer Science, University of Massachusetts - Lowell, March 2006. Available at http://www.cs.uml.edu/techrpts/reports.jsp.Google Scholar
- Y. Ye and G. Fischer. Supporting reuse by delivering taskrelevant and personalized information. In Proceedings of the 24th International Conference on Software Engineering, pages 513--523. ACM Press, May 2002. Google ScholarDigital Library
- Y. Ye, G. Fischer, and B. Reeves. Integrating active information delivery and reuse repository systems. In International Symposium on Foundations of Software Engineering, pages 60--68. ACM Press, November 2000. Google ScholarDigital Library
- A. M. Zaremski and J. M. Wing. Signature Matching: a Tool for Using Software Libraries. In ACM Transactions on Software Engineering and Methodology (TOSEM), pages 146--170. ACM Press, 1995. Google ScholarDigital Library
- A. M. Zaremski and J. M. Wing. Specification Matching of Software Components. In ACM Transactions on Software Engineering and Methodology (TOSEM), pages 333--369. ACM Press, 1997. Google ScholarDigital Library
Index Terms
- XSnippet: mining For sample code
Recommendations
Parseweb: a programmer assistant for reusing open source code on the web
ASE '07: Proceedings of the 22nd IEEE/ACM International Conference on Automated Software EngineeringProgrammers 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 ...
XSnippet: mining For sample code
OOPSLA '06: Proceedings of the 21st annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applicationsIt 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 ...
Locating Source Code to Be Fixed Based on Initial Bug Reports - A Case Study on the Eclipse Project
IWESEP '12: Proceedings of the 2012 Fourth International Workshop on Empirical Software Engineering in PracticeIn most software development, a Bug Tracking System is used to improve software quality. Based on bug reports managed by the bug tracking system, triagers who assign a bug to fixers and fixers need to pinpoint buggy files that should be fixed. However if ...
Comments