{"id":{"repo_id":"queens","oai_identifier":"oai:queensu.scholaris.ca:1974/13431"},"canonical_url":"https://search.ndltd.org/etd/queens/oai:queensu.scholaris.ca:1974/13431","repository":{"repo_id":"queens","name":"Queens University","base_url":"https://qspace.library.queensu.ca/server/oai/request"},"display":{"title":"Improving Code Search Using Learning-to-Rank and Query Reformulation Techniques","abstract":"During the process of software development, developers often encounter unfamiliar programming tasks. Online Q&A forums, such as StackOverflow, are one of the resources that developers can ask for answers to their programming questions. Automatic recommendation of a working code example can be helpful to solve developers’ programming questions. However, existing code search engines support mainly keyword-based queries, and do not accomodate well natural-language code search queries. Specifically, natural-language queries contain less technical keywords, i.e., class or method names, which negatively affects the success of the code search process of existing code search engines. On the other hand, a code search engine requires a ranking schema to place relevant code examples at the top of the result list. However, existing ranking schemas are hand-crafted heuristics where the configurations are hard to determine, which leads to the difficulty in using them for new languages or frameworks. In this paper, we propose the approach which uses query reformulation techniques to improve the search effectiveness of existing code search engines for naturallanguage queries. The approach automatically reformulate natural-language queries using class-names with semantic relations. We also propose an approach to automatically train a ranking schema for the code example search using the learning-to-rank technique. We evaluate the proposed approaches using a large-scale corpus of code examples. The evaluation results show that our approaches can effectively recommend semantically related class-names to reformulate natural-language queries, and the improvement on the search effectiveness over existing query reformulation approaches is statistically significant. The automatically trained ranking schema can effectively rank code examples, and outperform the existing ranking schemas by 35.65% and 48.42% in terms of normalized discounted cumulative gain (NDCG) and expected reciprocal rank (ERR), respectively.","abstract_html":"During the process of software development, developers often encounter unfamiliar programming tasks. Online Q&amp;A forums, such as StackOverflow, are one of the resources that developers can ask for answers to their programming questions. Automatic recommendation of a working code example can be helpful to solve developers’ programming questions. However, existing code search engines support mainly keyword-based queries, and do not accomodate well natural-language code search queries. Specifically, natural-language queries contain less technical keywords, i.e., class or method names, which negatively affects the success of the code search process of existing code search engines. On the other hand, a code search engine requires a ranking schema to place relevant code examples at the top of the result list. However, existing ranking schemas are hand-crafted heuristics where the configurations are hard to determine, which leads to the difficulty in using them for new languages or frameworks. In this paper, we propose the approach which uses query reformulation techniques to improve the search effectiveness of existing code search engines for naturallanguage queries. The approach automatically reformulate natural-language queries using class-names with semantic relations. We also propose an approach to automatically train a ranking schema for the code example search using the learning-to-rank technique. We evaluate the proposed approaches using a large-scale corpus of code examples. The evaluation results show that our approaches can effectively recommend semantically related class-names to reformulate natural-language queries, and the improvement on the search effectiveness over existing query reformulation approaches is statistically significant. The automatically trained ranking schema can effectively rank code examples, and outperform the existing ranking schemas by 35.65% and 48.42% in terms of normalized discounted cumulative gain (NDCG) and expected reciprocal rank (ERR), respectively.","abstract_has_math":false,"creators":["Niu, Haoran"],"institution":"Queen's University at Kingston","degree_name":null,"degree_level":null,"degree_discipline":null,"degree_department":"Electrical and Computer Engineering","school":null,"contributors":[],"advisors":["Zou, Ying"],"committee_chairs":[],"committee_members":[],"year":2015,"date_issued":"2015-07-24","date_published":"2015-07-24","updated_at":"2026-11-19T09:12:09Z","subjects":["Code Search"],"languages":["eng"],"rights":["Creative Commons - Attribution - CC BY"],"rights_urls":[],"identifier_entries":[],"person_identifier_entries":[]},"links":{"outbound_url":"https://hdl.handle.net/1974/13431","outbound_label":"Handle","outbound_source":"dc:identifier.uri","record_url":"https://hdl.handle.net/1974/13431","record_label":"Repository record","record_kind":"handle","record_source":"dc:identifier.uri","access_status":null,"embargo_until":null,"access_note":null},"oai_pmh_record":{"url":"https://union.ndltd.org/oai-pmh/?verb=GetRecord&metadataPrefix=oai_dc&identifier=oai%3Aunion.ndltd.org%3Arepo%3Aqueens%3Aoai%3Aqueensu.scholaris.ca%3A1974%2F13431","prefix":"oai_dc"},"source_record":{"url":"https://qspace.library.queensu.ca/server/oai/request?verb=GetRecord&metadataPrefix=dim&identifier=oai%3Aqueensu.scholaris.ca%3A1974%2F13431","prefix":"dim"},"metadata_groups":[{"id":"people","label":"People","entries":[{"key":"dc:contributor.department","label":"Department","values":["Electrical and Computer Engineering"]},{"key":"dc:contributor.supervisor","label":"Supervisor","values":["Zou, Ying"]},{"key":"dc:creator","label":"Author","values":["Niu, Haoran"]}]},{"id":"academic_context","label":"Academic Context","entries":[{"key":"dc:date","label":"Dc Date","values":["2015-07-22 21:32:49.992","2015-07-23 16:44:28.655"]},{"key":"dc:date.accessioned","label":"Dc Date Accessioned","values":["2015-07-24T17:49:06Z"]},{"key":"dc:date.available","label":"Dc Date Available","values":["2015-07-24T17:49:06Z"]},{"key":"dc:date.issued","label":"Date","values":["2015-07-24"]},{"key":"dc:relation.ispartofseries","label":"Dc Relation Ispartofseries","values":["Canadian theses"]},{"key":"dc:type","label":"Dc Type","values":["thesis"]},{"key":"thesis:institution_name","label":"Thesis Institution Name","values":["Queen's University at Kingston"]}]},{"id":"subjects_keywords","label":"Subjects and Keywords","entries":[{"key":"dc:subject","label":"Dc Subject","values":["Code Search"]}]},{"id":"language_rights","label":"Language and Rights","entries":[{"key":"dc:language.iso","label":"Language (ISO)","values":["eng"]},{"key":"dc:rights","label":"Dc Rights","values":["Creative Commons - Attribution - CC BY"]}]},{"id":"identifiers","label":"Identifiers","entries":[{"key":"dc:identifier.uri","label":"Identifier URI","values":["http://hdl.handle.net/1974/13431"]}]},{"id":"additional","label":"Additional Metadata","entries":[{"key":"dc:description","label":"Description","values":["Thesis (Master, Electrical & Computer Engineering) -- Queen's University, 2015-07-23 16:44:28.655"]},{"key":"dc:description.abstract","label":"Abstract","values":["During the process of software development, developers often encounter unfamiliar programming tasks. Online Q&A forums, such as StackOverflow, are one of the resources that developers can ask for answers to their programming questions. Automatic recommendation of a working code example can be helpful to solve developers’ programming questions. However, existing code search engines support mainly keyword-based queries, and do not accomodate well natural-language code search queries. Specifically, natural-language queries contain less technical keywords, i.e., class or method names, which negatively affects the success of the code search process of existing code search engines. On the other hand, a code search engine requires a ranking schema to place relevant code examples at the top of the result list. However, existing ranking schemas are hand-crafted heuristics where the configurations are hard to determine, which leads to the difficulty in using them for new languages or frameworks. In this paper, we propose the approach which uses query reformulation techniques to improve the search effectiveness of existing code search engines for naturallanguage queries. The approach automatically reformulate natural-language queries using class-names with semantic relations. We also propose an approach to automatically train a ranking schema for the code example search using the learning-to-rank technique. We evaluate the proposed approaches using a large-scale corpus of code examples. The evaluation results show that our approaches can effectively recommend semantically related class-names to reformulate natural-language queries, and the improvement on the search effectiveness over existing query reformulation approaches is statistically significant. The automatically trained ranking schema can effectively rank code examples, and outperform the existing ranking schemas by 35.65% and 48.42% in terms of normalized discounted cumulative gain (NDCG) and expected reciprocal rank (ERR), respectively."]},{"key":"dc:description.degree","label":"Dc Description Degree","values":["M.A.Sc."]},{"key":"dc:title","label":"Title","values":["Improving Code Search Using Learning-to-Rank and Query Reformulation Techniques"]},{"key":"others:access_status","label":"Others Access Status","values":["open.access"]}]}],"canonical_facts":{"dc:contributor.department":["Electrical and Computer Engineering"],"dc:contributor.supervisor":["Zou, Ying"],"dc:creator":["Niu, Haoran"],"dc:date":["2015-07-22 21:32:49.992","2015-07-23 16:44:28.655"],"dc:date.accessioned":["2015-07-24T17:49:06Z"],"dc:date.available":["2015-07-24T17:49:06Z"],"dc:date.issued":["2015-07-24"],"dc:description":["Thesis (Master, Electrical & Computer Engineering) -- Queen's University, 2015-07-23 16:44:28.655"],"dc:description.abstract":["During the process of software development, developers often encounter unfamiliar programming tasks. Online Q&A forums, such as StackOverflow, are one of the resources that developers can ask for answers to their programming questions. Automatic recommendation of a working code example can be helpful to solve developers’ programming questions. However, existing code search engines support mainly keyword-based queries, and do not accomodate well natural-language code search queries. Specifically, natural-language queries contain less technical keywords, i.e., class or method names, which negatively affects the success of the code search process of existing code search engines. On the other hand, a code search engine requires a ranking schema to place relevant code examples at the top of the result list. However, existing ranking schemas are hand-crafted heuristics where the configurations are hard to determine, which leads to the difficulty in using them for new languages or frameworks. In this paper, we propose the approach which uses query reformulation techniques to improve the search effectiveness of existing code search engines for naturallanguage queries. The approach automatically reformulate natural-language queries using class-names with semantic relations. We also propose an approach to automatically train a ranking schema for the code example search using the learning-to-rank technique. We evaluate the proposed approaches using a large-scale corpus of code examples. The evaluation results show that our approaches can effectively recommend semantically related class-names to reformulate natural-language queries, and the improvement on the search effectiveness over existing query reformulation approaches is statistically significant. The automatically trained ranking schema can effectively rank code examples, and outperform the existing ranking schemas by 35.65% and 48.42% in terms of normalized discounted cumulative gain (NDCG) and expected reciprocal rank (ERR), respectively."],"dc:description.degree":["M.A.Sc."],"dc:identifier.uri":["http://hdl.handle.net/1974/13431"],"dc:language.iso":["eng"],"dc:relation.ispartofseries":["Canadian theses"],"dc:rights":["Creative Commons - Attribution - CC BY"],"dc:subject":["Code Search"],"dc:title":["Improving Code Search Using Learning-to-Rank and Query Reformulation Techniques"],"dc:type":["thesis"],"others:access_status":["open.access"],"thesis:institution_name":["Queen's University at Kingston"]},"updated_at":"2026-11-19T09:12:09Z"}