Infrastructure for Building Code Search Applications for Developers

  • Sushil Krishna BajracharyaEmail author


The large availability of open source code on the Web provides great opportunities to build useful code search applications for developers. Building such applications requires addressing several challenges inherent in collecting and analyzing code from open source repositories to make them available for search. An infrastructure that supports collection, analysis, and search services for open source code available on the Web can greatly facilitate building effective code search applications. This chapter presents such an infrastructure called Sourcerer that facilitates collection, analysis, and search of source code available in code repositories on the Web. This chapter provides useful information to researchers and implementors of code search applications interested in harnessing the large availability of source code in the repositories on the Web. In particular, this chapter highlights key aspects of Sourcerer that supports combining Software Engineering and Information Retrieval techniques to build effective code search applications.


Source Code Retrieval Scheme Open Source Project Code Snippet Code Search 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.



The author would like to thank Joel Ossher, Otavio Lemos, Trung Ngo, Huy Hunh, Paul Rigor, and Erik Linsted for their contributions to the Sourcerer infrastructure. The author would like to thank Cristina Lopes and Pierre Baldi for their advice and support in making Sourcerer successful.


  1. [1]
    Bajracharya, S., Ngo, T., Linstead, E., Dou, Y., Rigor, P., Baldi, P., Lopes, C.: Sourcerer: a search engine for open source code supporting structure-based search. pp. 681–682. ACM Press, New York, NY, USA (2006). DOI
  2. [2]
    Bajracharya, S., Ossher, J., Lopes, C.: Sourcerer: An internet-scale software repository. In: Proceedings of the 2009 ICSE Workshop on Search-Driven Development-Users, Infrastructure, Tools and Evaluation, pp. 1–4. IEEE Computer Society (2009)Google Scholar
  3. [3]
    Bajracharya, S., Ossher, J., Lopes, C.: Leveraging usage similarity for effective retrieval of examples in code repositories. 18th International Symposium on the Foundations of Software Engineering (2010)Google Scholar
  4. [4]
    Bajracharya, S., Ossher, J., Lopes, C.: Searching API usage examples in code repositories with sourcerer API search. In: Proceedings of 2010 ICSE Workshop on Search-driven Development: Users, Infrastructure, Tools and Evaluation, pp. 5–8. ACM, Cape Town, South Africa (2010). DOI 10.1145/1809175.1809177Google Scholar
  5. [5]
    Bajracharya, S., Ossher, J., Lopes, C.: Sourcerer: An infrastructure for the large-scale collection and analysis of open-source code. Science of Computer Programming (To Appear) (2012)Google Scholar
  6. [6]
    Bajracharya, S.K.: Facilitating internet-scale code retrieval. Ph.D. thesis, University of California Irvine (2010)Google Scholar
  7. [7]
    Chen, Y., Gansner, E.R., Koutsofios, E.: A c++ data model supporting reachability analysis and dead code detection. IEEE Trans. Softw. Eng. 24(9), 682–694 (1998)CrossRefGoogle Scholar
  8. [8]
    Furnas, G.W., Landauer, T.K., Gomez, L.M., Dumais, S.T.: The vocabulary problem in human-system communication. Commun. ACM 30, 964–971 (1987). DOI 10.1145/32206.32212CrossRefGoogle Scholar
  9. [9]
    Garcia, V., de Almeida, E., Lisboa, L., Martins, A., Meira, S., Lucredio, D., de M. Fortes, R.: Toward a code search engine based on the State-of-Art and practice. In: Software Engineering Conference, 2006. APSEC 2006. 13th Asia Pacific, pp. 61–70 (2006)Google Scholar
  10. [10]
    Garcia, V., Lucrédio, D., Durão, F., Santos, E., de Almeida, E., de Mattos Fortes, R., de Lemos Meira, S.: From Specification to Experimentation: A Software Component Search Engine Architecture. In: I. Gorton, G. Heineman, I. Crnkovic, H. Schmidt, J. Stafford, C. Szyperski, K. Wallnau (eds.) Component-Based Software Engineering, Lecture Notes in Computer Science, vol. 4063, pp. 82–97. Springer Berlin / Heidelberg (2006)Google Scholar
  11. [11]
    Gil, J.Y., Maman, I.: Micro patterns in java code. In: OOPSLA ’05: Proceedings of the 20th annual ACM SIGPLAN conference on Object oriented programming systems languages and applications, pp. 97–116. ACM Press, New York, NY, USA (2005). DOI
  12. [12]
    Gosling, J., Joy, B., Steele, G., Bracha, G.: Java(TM) Language Specification, The, 3 edn. Addison Wesley (2005)Google Scholar
  13. [13]
    Howison, J., Conklin, M., Crowston, K.: FLOSSmole: A collaborative repository for FLOSS research data and analyses. International Journal of Information Technology and Web Engineering 1(3), 17–26 (2006)CrossRefGoogle Scholar
  14. [14]
    Hummel, O., Janjic, W., Atkinson, C.: Code conjurer: Pulling reusable software out of thin air. IEEE Softw. 25(5), 45–52 (2008)CrossRefGoogle Scholar
  15. [15]
    Lawrence Page Sergey Brin, R.M., Winograd, T.: The pagerank citation ranking: Bringing order to the web. Stanford Digital Library working paper SIDL-WP-1999-0120 of 11/11/1999 (see:
  16. [16]
    Lemos, O.A.L., Bajracharya, S., Ossher, J., Masiero, P.C., Lopes, C.: Applying test-driven code search to the reuse of auxiliary functionality. In: Proceedings of the 2009 ACM symposium on Applied Computing, pp. 476–482. ACM, Honolulu, Hawaii (2009). DOI 10.1145/1529282. 1529384Google Scholar
  17. [17]
    Lemos, O.A.L., Bajracharya, S.K., Ossher, J.: CodeGenie: a tool for test-driven source code search. In: Companion to the 22nd ACM SIGPLAN conference on Object-oriented programming systems and applications companion, pp. 917–918. ACM, Montreal, Quebec, Canada (2007). DOI 10.1145/1297846.1297944Google Scholar
  18. [18]
    Lemos, O.A.L., Bajracharya, S.K., Ossher, J., Masiero, P.C., Lopes, C.V.: A test-driven approach to code search and its application to the reuse of auxiliary functionality. Information and Software Technology (2011)Google Scholar
  19. [19]
    Lemos, O.A.L., Bajracharya, S.K., Ossher, J., Morla, R.S., Masiero, P.C., Baldi, P., Lopes, C.V.: CodeGenie: using test-cases to search and reuse source code. In: Proceedings of the twenty-second IEEE/ACM international conference on Automated software engineering, pp. 525–526. ACM, Atlanta, Georgia, USA (2007)Google Scholar
  20. [20]
    Linstead, E., Bajracharya, S., Ngo, T., Rigor, P., Lopes, C., Baldi, P.: Sourcerer: mining and searching internet-scale software repositories. Data Mining and Knowledge Discovery 18(2), 300–336 (2009). DOI 10. 1007/s10618-008-0118-xGoogle Scholar
  21. [21]
    Lopes, C., Bajracharya, S., Ossher, J., Baldi, P.: UCI source code data sets (2010). URL∼lopes/datasets/
  22. [22]
    Lungu, M., Lanza, M., Nierstrasz, O.: Evolutionary and collaborative software architecture recovery with softwarenaut. In: Science of Computer Programming (SCP), (to appear) (2012)Google Scholar
  23. [23]
    Manning, C.D., Raghavan, P., Schütze, H.: Introduction to Information Retrieval, 1 edn. Cambridge University Press (2008)Google Scholar
  24. [24]
    Masuhara, H., Murakami, N., Watanabe, T.: Duplication removal for a search-based recommendation system. In: Proceedings of the 4th International Workshop on Search-Driven Development: Users, Infrastructure, Tools, and Evaluation, SUITE ’12. ACM, New York, NY, USA (2012)Google Scholar
  25. [25]
    McCandless, M., Hatcher, E., Gospodnetic, O.: Lucene in Action, 2 edn. Manning Publications (2010)Google Scholar
  26. [26]
    McMillan, C., Grechanik, M., Poshyvanyk, D., Xie, Q., Fu, C.: Portfolio: finding relevant functions and their usage. In: Software Engineering (ICSE), 2011 33rd International Conference on, pp. 111–120 (2011). DOI 10.1145/1985793.1985809Google Scholar
  27. [27]
    Murakami, N., Masuhara, H., Watanabe, T.: Optimizing a search-based code recommendation system. In: Proceedings of 3rd International Workshop on Recommendation Systems for Software Engineering, RSSE ’12. ACM, New York, NY, USA (2012)Google Scholar
  28. [28]
    Ossher, J., Bajracharya, S., Lopes, C.: Automated dependency resolution for open source software. In: 2010 7th IEEE Working Conference on Mining Software Repositories (MSR 2010), pp. 130–140. Cape Town, South Africa (2010). DOI 10.1109/MSR.2010.5463346Google Scholar
  29. [29]
    Reiss, S.P.: Semantics-based code search. In: Proceedings of the 2009 IEEE 31st International Conference on Software Engineering - Volume 00, pp. 243–253. IEEE Computer Society (2009)Google Scholar
  30. [30]
    Takuya, W., Masuhara, H.: A spontaneous code recommendation tool based on associative search. In: Proceedings of the 3rd International Workshop on Search-Driven Development: Users, Infrastructure, Tools, and Evaluation, SUITE ’11, pp. 17–20. ACM, New York, NY, USA (2011). DOI 10.1145/1985429.1985434Google Scholar
  31. [31]
    Thummalapenta, S., Xie, T.: Parseweb: a programmer assistant for reusing open source code on the web. In: Proceedings of the twenty-second IEEE/ ACM international conference on Automated software engineering, pp. 204–213. ACM, Atlanta, Georgia, USA (2007). 10.1145/1321631.1321663Google Scholar
  32. [32]
    Web Page for FLOSSmole Project: (2012)
  33. [33]
    Web Page for Portfolio: (2012)
  34. [34]
    Web Page for Sourcerer Project and the Sourcerer Code Search Engine: (2012)
  35. [35]
    Web Page for Sourcerer Web Services: (2010)
  36. [36]
    Web page for Sourcerer’s github repository: (2010)
  37. [37]
    Web Page on Apache Lucene Scoring: (2010)
  38. [38]
    Web Site for Apache Software Foundation: (2010)
  39. [39]
    Web Site for Google Code Hosting: (2010)
  40. [40]
    Web site for (2010)
  41. [41]
    Web Site for Lucene: (2010)
  42. [42]
    Web site for Maven: (2010)
  43. [43]
    Web Site for Maven’s Central Repository: (2010)
  44. [44]
    Web Site for Sourceforge: (2010)
  45. [45]
    Web site for Tigris: (2010)

Copyright information

© Springer Science+Business Media New York 2013

Authors and Affiliations

  1. 1.Black Duck SoftwareBurlingtonUSA

Personalised recommendations