skip to main content
10.1145/3079368.3079372acmotherconferencesArticle/Chapter ViewAbstractPublication PagesprogrammingConference Proceedingsconference-collections
extended-abstract

A Similarity-Based Method Retrieval Technique to Improve Effectiveness in Code Search

Published: 03 April 2017 Publication History

Abstract

The effectiveness of a code search engine is reduced if semantically similar code fragments are not indexed under common and proper terms. In this paper, a technique named Feature-Wise Similar Method Finder (FWSMF) is proposed which checks functional similarity among codes by executing and matching outputs against the same set of inputs. It then determines appropriate index terms by finding keywords that are found in most of the code snippets. As a result, code fragments that contain different keywords but implement the same feature, can be retrieved all together. Experimental analysis shows that on an average, FWSMF produces 61% and 29% more precision than two existing techniques named Keyword Based Code Search (KBCS) and Interface Driven Code Search (IDCS) respectively. It also shows 34% and 55% more recall than KBCS and IDCS correspondingly. It retrieves self executable code snippets which can be easily pluggable in the intended development context and thus reduces time and effort while reusing code.

References

[1]
Sushil Bajracharya, Trung Ngo, Erik Linstead, Yimeng Dou, Paul Rigor, Pierre Baldi, and Cristina Lopes. 2006. Sourcerer: a search engine for open source code supporting structure-based search. In Companion to the 21st ACM SIGPLAN symposium on Object-oriented programming systems, languages, and applications. ACM, 681--682.
[2]
Andrew Begel. 2007. Codifier: a programmer-centric search user interface. In Proceedings of the workshop on human-computer interaction and information retrieval. 23--24.
[3]
Yingnong Dang, Dongmei Zhang, Song Ge, Chengyun Chu, Yingjun Qiu, and Tao Xie. 2012. XIAO: tuning code clones at hands of engineers in practice. In Proceedings of the 28th Annual Computer Security Applications Conference. ACM, 369--378.
[4]
Reid Holmes, Robert J Walker, and Gail C Murphy. 2005. Strathcona example recommendation tool. In ACM SIGSOFT Software Engineering Notes, Vol. 30. ACM, 237--240.
[5]
Oliver Hummel, Werner Janjic, and Colin Atkinson. 2008. Code conjurer: Pulling reusable software out of thin air. IEEE software 25, 5 (2008), 45--52.
[6]
Werner Janjic and Colin Atkinson. 2012. Leveraging software search and reuse with automated software adaptation. In Search-Driven Development-Users, Infrastructure, Tools and Evaluation (SUITE), 2012 ICSE Workshop on. IEEE, 23--26.
[7]
Otávio Augusto Lazzarini Lemos, Sushil Krishna Bajracharya, and Joel Ossher. 2007. 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. ACM, 917--918.
[8]
Otávio AL Lemos, Adriano C de Paula, Felipe C Zanichelli, and Cristina V Lopes. 2014. Thesaurus-based automatic query expansion for interface-driven code search. In Proceedings of the 11th Working Conference on Mining Software Repositories. ACM, 212--221.
[9]
OtáVio Augusto Lazzarini Lemos, Sushil Bajracharya, Joel Ossher, Paulo Cesar Masiero, and Cristina Lopes. 2011. A test-driven approach to code search and its application to the reuse of auxiliary functionality. Information and Software Technology 53, 4 (2011), 294--306.
[10]
Otávio Augusto Lazzarini Lemos, Adriano Carvalho de Paula, Hitesh Sajnani, and Cristina V Lopes. 2015. Can the use of types and query expansion help improve large-scale code search?. In 15th International Working Conference on Source Code Analysis and Manipulation (SCAM). IEEE, 41--50.
[11]
Erik Linstead, Paul Rigor, Sushil Bajracharya, Cristina Lopes, and Pierre Baldi. 2007. Mining concepts from code with probabilistic topic models. In Proceedings of the twenty-second IEEE/ACM international conference on Automated software engineering. ACM, 461--464.
[12]
Steven P Reiss. 2009. Semantics-based code search. In Proceedings of the 31st International Conference on Software Engineering. IEEE Computer Society, 243--253.
[13]
Naiyana Sahavechaphan and Kajal Claypool. 2006. XSnippet: mining for sample code ACM Sigplan Notices 41, 10 (2006), 413--430.
[14]
Susan Elliott Sim and Rosalva E Gallardo-Valencia. 2013. Finding source code on the web for remix and reuse. Springer.
[15]
Renuka Sindhgatta. 2006. Using an information retrieval system to retrieve source code samples. In Proceedings of the 28th international conference on Software engineering. ACM, 905--908.
[16]
Suresh Thummalapenta and Tao Xie. 2007. Parseweb: a programmer assistant for reusing open source code on the web. In Proceedings of the 22nd IEEE/ACM international conference on Automated software engineering. ACM, 204--213.
[17]
Amy Moormann Zaremski and Jeannette M Wing. 1995. Signature matching: a tool for using software libraries. ACM Transactions on Software Engineering and Methodology (TOSEM) 4, 2 (1995), 146--170.

Cited By

View all
  • (2024)Evaluation of Code Similarity Search Strategies in Large-Scale CodebasesTransactions on Large-Scale Data- and Knowledge-Centered Systems LVII10.1007/978-3-662-70140-9_4(99-113)Online publication date: 25-Oct-2024
  • (2021)Validating static warnings via testing code fragmentsProceedings of the 30th ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3460319.3464832(540-552)Online publication date: 11-Jul-2021
  • (2021)Embedding API dependency graph for neural code generationEmpirical Software Engineering10.1007/s10664-021-09968-226:4Online publication date: 21-Apr-2021
  • Show More Cited By

Index Terms

  1. A Similarity-Based Method Retrieval Technique to Improve Effectiveness in Code Search

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Other conferences
    Programming '17: Companion Proceedings of the 1st International Conference on the Art, Science, and Engineering of Programming
    April 2017
    193 pages
    ISBN:9781450348362
    DOI:10.1145/3079368
    Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for third-party components of this work must be honored. For all other uses, contact the Owner/Author.

    In-Cooperation

    • AOSA: Aspect-Oriented Software Association

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 03 April 2017

    Check for updates

    Author Tags

    1. Code Search
    2. Self-Executable Method
    3. Software Reuse

    Qualifiers

    • Extended-abstract
    • Research
    • Refereed limited

    Conference

    Programming '17

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)1
    • Downloads (Last 6 weeks)0
    Reflects downloads up to 27 Feb 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2024)Evaluation of Code Similarity Search Strategies in Large-Scale CodebasesTransactions on Large-Scale Data- and Knowledge-Centered Systems LVII10.1007/978-3-662-70140-9_4(99-113)Online publication date: 25-Oct-2024
    • (2021)Validating static warnings via testing code fragmentsProceedings of the 30th ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3460319.3464832(540-552)Online publication date: 11-Jul-2021
    • (2021)Embedding API dependency graph for neural code generationEmpirical Software Engineering10.1007/s10664-021-09968-226:4Online publication date: 21-Apr-2021
    • (2017)An Exploratory Study on Interface Similarities in Code Clones2017 24th Asia-Pacific Software Engineering Conference Workshops (APSECW)10.1109/APSECW.2017.24(126-133)Online publication date: Dec-2017
    • (2017)Retrieving Self-Executable and Functionally Correct Code to Improve Source Code Search2017 24th Asia-Pacific Software Engineering Conference (APSEC)10.1109/APSEC.2017.98(749-750)Online publication date: Dec-2017

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Figures

    Tables

    Media

    Share

    Share

    Share this Publication link

    Share on social media