{"id":215151,"date":"2015-11-01T00:00:00","date_gmt":"2015-11-01T00:00:00","guid":{"rendered":"https:\/\/www.microsoft.com\/en-us\/research\/msr-research-item\/codehow-effective-code-search-based-on-api-understanding-and-extended-boolean-model\/"},"modified":"2019-03-20T22:33:18","modified_gmt":"2019-03-21T05:33:18","slug":"codehow-effective-code-search-based-on-api-understanding-and-extended-boolean-model","status":"publish","type":"msr-research-item","link":"https:\/\/www.microsoft.com\/en-us\/research\/publication\/codehow-effective-code-search-based-on-api-understanding-and-extended-boolean-model\/","title":{"rendered":"CodeHow: Effective Code Search based on API Understanding and Extended Boolean Model"},"content":{"rendered":"

Over\u00a0 the\u00a0 years\u00a0 of\u00a0 software\u00a0 development,\u00a0 a\u00a0 vast amount of source code has been accumulated. Many code search tools\u00a0 were\u00a0 proposed\u00a0 to\u00a0 help\u00a0 programmers\u00a0 reuse\u00a0 previously written code by performing free-text queries over a large-scale codebase. Our experience shows that the accuracy of these code search tools are often unsatisfactory. One major reason is that existing tools lack of query understanding ability.<\/p>\n

In this paper, we propose CodeHow, a code search technique that can recognize potential\u00a0 APIs\u00a0 a\u00a0 user\u00a0 query\u00a0 refers\u00a0 to.\u00a0 Having\u00a0 understood\u00a0 the potentially relevant APIs, CodeHow expands the query with the APIs\u00a0 and\u00a0 performs\u00a0 code\u00a0 retrieval\u00a0 by\u00a0 applying\u00a0 the\u00a0 Extended Boolean model, which considers the impact of both text similarity and potential APIs on code search. We deploy the backend of CodeHow as a Microsoft Azure service and implement the front-end as a Visual Studio extension. We evaluate CodeHow on a large-scale codebase consisting of 26K C# projects downloaded from GitHub. The experimental results show that when the top 1\u00a0 results\u00a0 are\u00a0 inspected,\u00a0 CodeHow\u00a0 achieves\u00a0 a\u00a0 precision\u00a0 score of\u00a0 0.794\u00a0 (i.e.,\u00a0 79.4%\u00a0 of\u00a0 the\u00a0 first\u00a0 returned\u00a0 results\u00a0 are\u00a0 relevant code snippets). The results also show that CodeHow outperforms conventional\u00a0 code\u00a0 search\u00a0 tools.\u00a0 Furthermore,\u00a0 we\u00a0 perform\u00a0 a controlled experiment and a survey of Microsoft developers. The results confirm the usefulness and effectiveness of CodeHow in programming practices.<\/p>\n","protected":false},"excerpt":{"rendered":"

Over\u00a0 the\u00a0 years\u00a0 of\u00a0 software\u00a0 development,\u00a0 a\u00a0 vast amount of source code has been accumulated. Many code search tools\u00a0 were\u00a0 proposed\u00a0 to\u00a0 help\u00a0 programmers\u00a0 reuse\u00a0 previously written code by performing free-text queries over a large-scale codebase. Our experience shows that the accuracy of these code search tools are often unsatisfactory. One major reason is that […]<\/p>\n","protected":false},"featured_media":0,"template":"","meta":{"msr-url-field":"","msr-podcast-episode":"","msrModifiedDate":"","msrModifiedDateEnabled":false,"ep_exclude_from_search":false,"footnotes":""},"msr-content-type":[3],"msr-research-highlight":[],"research-area":[13560,13555],"msr-publication-type":[193716],"msr-product-type":[],"msr-focus-area":[],"msr-platform":[],"msr-download-source":[],"msr-locale":[268875],"msr-field-of-study":[],"msr-conference":[],"msr-journal":[],"msr-impact-theme":[],"msr-pillar":[],"class_list":["post-215151","msr-research-item","type-msr-research-item","status-publish","hentry","msr-research-area-programming-languages-software-engineering","msr-research-area-search-information-retrieval","msr-locale-en_us"],"msr_publishername":"ACM - Association for Computing Machinery","msr_edition":"","msr_affiliation":"","msr_published_date":"2015-8-1","msr_host":"","msr_duration":"","msr_version":"","msr_speaker":"","msr_other_contributors":"","msr_booktitle":"","msr_pages_string":"","msr_chapter":"","msr_isbn":"","msr_journal":"","msr_volume":"","msr_number":"","msr_editors":"","msr_series":"","msr_issue":"","msr_organization":"","msr_how_published":"","msr_notes":"","msr_highlight_text":"","msr_release_tracker_id":"","msr_original_fields_of_study":"","msr_download_urls":"","msr_external_url":"","msr_secondary_video_url":"","msr_longbiography":"","msr_microsoftintellectualproperty":1,"msr_main_download":"","msr_publicationurl":"","msr_doi":"","msr_publication_uploader":[{"type":"file","viewUrl":"https:\/\/www.microsoft.com\/en-us\/research\/uploads\/prod\/2015\/11\/ASE-2015-CodeHow-Effective-Code-Search-based-on-API-Understanding-and-Extended-Boolean-Model.pdf","id":"574875","title":"ase-2015-codehow-effective-code-search-based-on-api-understanding-and-extended-boolean-model","label_id":"243103","label":0}],"msr_related_uploader":"","msr_attachments":[{"id":574875,"url":"https:\/\/www.microsoft.com\/en-us\/research\/uploads\/prod\/2019\/03\/ASE-2015-CodeHow-Effective-Code-Search-based-on-API-Understanding-and-Extended-Boolean-Model.pdf"}],"msr-author-ordering":[{"type":"text","value":"Fei LV","user_id":0,"rest_url":false},{"type":"text","value":"hongyu zhang","user_id":0,"rest_url":false},{"type":"user_nicename","value":"Jian-Guang Lou","user_id":32337,"rest_url":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/microsoft-research\/v1\/researchers?person=Jian-Guang Lou"},{"type":"text","value":"Shaowei WANG","user_id":0,"rest_url":false},{"type":"user_nicename","value":"Dongmei Zhang","user_id":31665,"rest_url":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/microsoft-research\/v1\/researchers?person=Dongmei Zhang"},{"type":"text","value":"Jianjun ZHAO","user_id":0,"rest_url":false},{"type":"text","value":"jianjun zhao","user_id":0,"rest_url":false}],"msr_impact_theme":[],"msr_research_lab":[199560],"msr_event":[],"msr_group":[144847],"msr_project":[],"publication":[],"video":[],"download":[],"msr_publication_type":"inproceedings","_links":{"self":[{"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-research-item\/215151"}],"collection":[{"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-research-item"}],"about":[{"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/types\/msr-research-item"}],"version-history":[{"count":4,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-research-item\/215151\/revisions"}],"predecessor-version":[{"id":574878,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-research-item\/215151\/revisions\/574878"}],"wp:attachment":[{"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/media?parent=215151"}],"wp:term":[{"taxonomy":"msr-content-type","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-content-type?post=215151"},{"taxonomy":"msr-research-highlight","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-research-highlight?post=215151"},{"taxonomy":"msr-research-area","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/research-area?post=215151"},{"taxonomy":"msr-publication-type","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-publication-type?post=215151"},{"taxonomy":"msr-product-type","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-product-type?post=215151"},{"taxonomy":"msr-focus-area","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-focus-area?post=215151"},{"taxonomy":"msr-platform","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-platform?post=215151"},{"taxonomy":"msr-download-source","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-download-source?post=215151"},{"taxonomy":"msr-locale","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-locale?post=215151"},{"taxonomy":"msr-field-of-study","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-field-of-study?post=215151"},{"taxonomy":"msr-conference","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-conference?post=215151"},{"taxonomy":"msr-journal","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-journal?post=215151"},{"taxonomy":"msr-impact-theme","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-impact-theme?post=215151"},{"taxonomy":"msr-pillar","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-pillar?post=215151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}