{"id":{"repo_id":"calgary","oai_identifier":"oai:ucalgary.scholaris.ca:11023/1428"},"canonical_url":"https://search.ndltd.org/etd/calgary/oai:ucalgary.scholaris.ca:11023/1428","repository":{"repo_id":"calgary","name":"University of Calgary","base_url":"https://ucalgary.scholaris.ca/server/oai/request"},"display":{"title":"Test-Driven Reuse: Improving the Selection of Semantically Relevant Code","abstract":"Test-driven reuse (TDR) proposes to find reusable source code through the provision of test cases describing the functionality of interest to a developer. The vocabulary and design of the interface of the function under test is used as the basis of selecting potentially relevant candidate functions to be tested. This approach requires that the searcher know—or correctly guess—the solution’s interface vocabulary and design. However, semantic similarity neither implies nor is implied by syntactic or structural similarity. According to empirical studies, behaviourally similar code of independent origin can be syntactically very dissimilar. We believe test cases that exercise a function provide additional facts for describing its semantics. Therefore, the thesis of this dissertation is that by modelling tests—in addition to function interfaces—the odds of finding semantically relevant source code is improved. Additionally, to facilitate similarity comparisons and improve performance, we propose a multi-representation approach to building a reuse library. To validate these claims we created a similarity model using lexical, structural, and data flow attributes of test cases. Four similarity heuristics utilize this model to independently find relevant test cases that exercise similar functionality. We developed a proof of concept TDR tool, called Reviver, that finds existing test cases exercising similar functions once given a new set of test cases. Using Reviver a developer writing tests for a new functionality can reuse or learn from similar functions developed in the past. We evaluated the effectiveness of Reviver in a controlled study using tasks and their manually generated approximations. We experimented with different configurations of Reviver and found that overall the combination of lexical and data flow similarity heuristics is more likely to find an existing implementation of the function under test. Our results confirm that lexical, structural, and data flow facts in the test cases exercising a function—in addition to the interface of function under test—improve selection of semantically relevant functions.","abstract_html":"Test-driven reuse (TDR) proposes to find reusable source code through the provision of test cases describing the functionality of interest to a developer. The vocabulary and design of the interface of the function under test is used as the basis of selecting potentially relevant candidate functions to be tested. This approach requires that the searcher know—or correctly guess—the solution’s interface vocabulary and design. However, semantic similarity neither implies nor is implied by syntactic or structural similarity. According to empirical studies, behaviourally similar code of independent origin can be syntactically very dissimilar. We believe test cases that exercise a function provide additional facts for describing its semantics. Therefore, the thesis of this dissertation is that by modelling tests—in addition to function interfaces—the odds of finding semantically relevant source code is improved. Additionally, to facilitate similarity comparisons and improve performance, we propose a multi-representation approach to building a reuse library. To validate these claims we created a similarity model using lexical, structural, and data flow attributes of test cases. Four similarity heuristics utilize this model to independently find relevant test cases that exercise similar functionality. We developed a proof of concept TDR tool, called Reviver, that finds existing test cases exercising similar functions once given a new set of test cases. Using Reviver a developer writing tests for a new functionality can reuse or learn from similar functions developed in the past. We evaluated the effectiveness of Reviver in a controlled study using tasks and their manually generated approximations. We experimented with different configurations of Reviver and found that overall the combination of lexical and data flow similarity heuristics is more likely to find an existing implementation of the function under test. Our results confirm that lexical, structural, and data flow facts in the test cases exercising a function—in addition to the interface of function under test—improve selection of semantically relevant functions.","abstract_has_math":false,"creators":["Nurolahzade, Mehrdad"],"institution":"Graduate Studies","degree_name":"Doctor of Philosophy (PhD)","degree_level":null,"degree_discipline":"Computer Science","degree_department":null,"school":null,"contributors":[],"advisors":["Maurer, Frank","Walker, Robert J."],"committee_chairs":[],"committee_members":[],"year":2014,"date_issued":"2014-04-23","date_published":"2014-04-23","updated_at":"2026-11-19T07:26:53Z","subjects":["Computer Science"],"languages":["eng"],"rights":["University of Calgary graduate students retain copyright ownership and moral rights for their thesis. You may use this material in any way that is permitted by the Copyright Act or through licensing that has been assigned to the document. For uses that are not allowable under copyright legislation or licensing, you are required to seek permission."],"rights_urls":[],"identifier_entries":[{"key":"dc:identifier.uri","label":"Identifier URI","values":["http://hdl.handle.net/11023/1428"],"render_values":[{"text":"http://hdl.handle.net/11023/1428","href":"https://hdl.handle.net/11023/1428","code":true}]}],"person_identifier_entries":[]},"links":{"outbound_url":"https://doi.org/10.11575/PRISM/28000","outbound_label":"DOI","outbound_source":"dc:identifier.doi","record_url":"https://doi.org/10.11575/PRISM/28000","record_label":"Repository record","record_kind":"doi","record_source":"dc:identifier.doi","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%3Acalgary%3Aoai%3Aucalgary.scholaris.ca%3A11023%2F1428","prefix":"oai_dc"},"source_record":{"url":"https://ucalgary.scholaris.ca/server/oai/request?verb=GetRecord&metadataPrefix=dim&identifier=oai%3Aucalgary.scholaris.ca%3A11023%2F1428","prefix":"dim"},"metadata_groups":[{"id":"people","label":"People","entries":[{"key":"dc:contributor.advisor","label":"Advisor","values":["Maurer, Frank","Walker, Robert J."]},{"key":"dc:creator","label":"Author","values":["Nurolahzade, Mehrdad"]}]},{"id":"academic_context","label":"Academic Context","entries":[{"key":"dc:date.accessioned","label":"Dc Date Accessioned","values":["2014-04-23T17:19:30Z"]},{"key":"dc:date.available","label":"Dc Date Available","values":["2014-06-16T07:00:32Z"]},{"key":"dc:date.issued","label":"Date","values":["2014-04-23"]},{"key":"dc:date.submitted","label":"Dc Date Submitted","values":["2014"]},{"key":"dc:publisher.faculty","label":"Dc Publisher Faculty","values":["Graduate Studies"]},{"key":"dc:publisher.institution","label":"Dc Publisher Institution","values":["University of Calgary"]},{"key":"dc:publisher.place","label":"Dc Publisher Place","values":["Calgary"]},{"key":"dc:type","label":"Dc Type","values":["doctoral thesis"]},{"key":"thesis:degree_discipline","label":"Discipline","values":["Computer Science"]},{"key":"thesis:degree_name","label":"Degree Name","values":["Doctor of Philosophy (PhD)"]},{"key":"thesis:institution_name","label":"Thesis Institution Name","values":["University of Calgary"]}]},{"id":"subjects_keywords","label":"Subjects and Keywords","entries":[{"key":"dc:subject","label":"Dc Subject","values":["Computer Science"]},{"key":"dc:subject.classification","label":"Dc Subject Classification","values":["Reuse","Test","Similarity"]}]},{"id":"language_rights","label":"Language and Rights","entries":[{"key":"dc:language.iso","label":"Language (ISO)","values":["eng"]},{"key":"dc:rights","label":"Dc Rights","values":["University of Calgary graduate students retain copyright ownership and moral rights for their thesis. You may use this material in any way that is permitted by the Copyright Act or through licensing that has been assigned to the document. For uses that are not allowable under copyright legislation or licensing, you are required to seek permission."]}]},{"id":"identifiers","label":"Identifiers","entries":[{"key":"dc:identifier.citation","label":"Dc Identifier Citation","values":["Nurolahzade, M. (2014). Test-Driven Reuse: Improving the Selection of Semantically Relevant Code (Doctoral thesis, University of Calgary, Calgary, Canada). Retrieved from https://prism.ucalgary.ca. doi:10.11575/PRISM/28000"]},{"key":"dc:identifier.doi","label":"DOI","values":["http://dx.doi.org/10.11575/PRISM/28000"]},{"key":"dc:identifier.uri","label":"Identifier URI","values":["http://hdl.handle.net/11023/1428"]}]},{"id":"additional","label":"Additional Metadata","entries":[{"key":"atmire:migration.oldid","label":"Atmire Migration Oldid","values":["2025"]},{"key":"dc:description.abstract","label":"Abstract","values":["Test-driven reuse (TDR) proposes to find reusable source code through the provision of test cases describing the functionality of interest to a developer. The vocabulary and design of the interface of the function under test is used as the basis of selecting potentially relevant candidate functions to be tested. This approach requires that the searcher know—or correctly guess—the solution’s interface vocabulary and design. However, semantic similarity neither implies nor is implied by syntactic or structural similarity. According to empirical studies, behaviourally similar code of independent origin can be syntactically very dissimilar. We believe test cases that exercise a function provide additional facts for describing its semantics. Therefore, the thesis of this dissertation is that by modelling tests—in addition to function interfaces—the odds of finding semantically relevant source code is improved. Additionally, to facilitate similarity comparisons and improve performance, we propose a multi-representation approach to building a reuse library. To validate these claims we created a similarity model using lexical, structural, and data flow attributes of test cases. Four similarity heuristics utilize this model to independently find relevant test cases that exercise similar functionality. We developed a proof of concept TDR tool, called Reviver, that finds existing test cases exercising similar functions once given a new set of test cases. Using Reviver a developer writing tests for a new functionality can reuse or learn from similar functions developed in the past. We evaluated the effectiveness of Reviver in a controlled study using tasks and their manually generated approximations. We experimented with different configurations of Reviver and found that overall the combination of lexical and data flow similarity heuristics is more likely to find an existing implementation of the function under test. Our results confirm that lexical, structural, and data flow facts in the test cases exercising a function—in addition to the interface of function under test—improve selection of semantically relevant functions."]},{"key":"dc:title","label":"Title","values":["Test-Driven Reuse: Improving the Selection of Semantically Relevant Code"]},{"key":"dspace:entity.type","label":"Dspace Entity Type","values":["Publication"]},{"key":"local:request.copy","label":"Local Request Copy","values":["true"]},{"key":"others:access_status","label":"Others Access Status","values":["open.access"]}]}],"canonical_facts":{"atmire:migration.oldid":["2025"],"dc:contributor.advisor":["Maurer, Frank","Walker, Robert J."],"dc:creator":["Nurolahzade, Mehrdad"],"dc:date.accessioned":["2014-04-23T17:19:30Z"],"dc:date.available":["2014-06-16T07:00:32Z"],"dc:date.issued":["2014-04-23"],"dc:date.submitted":["2014"],"dc:description.abstract":["Test-driven reuse (TDR) proposes to find reusable source code through the provision of test cases describing the functionality of interest to a developer. The vocabulary and design of the interface of the function under test is used as the basis of selecting potentially relevant candidate functions to be tested. This approach requires that the searcher know—or correctly guess—the solution’s interface vocabulary and design. However, semantic similarity neither implies nor is implied by syntactic or structural similarity. According to empirical studies, behaviourally similar code of independent origin can be syntactically very dissimilar. We believe test cases that exercise a function provide additional facts for describing its semantics. Therefore, the thesis of this dissertation is that by modelling tests—in addition to function interfaces—the odds of finding semantically relevant source code is improved. Additionally, to facilitate similarity comparisons and improve performance, we propose a multi-representation approach to building a reuse library. To validate these claims we created a similarity model using lexical, structural, and data flow attributes of test cases. Four similarity heuristics utilize this model to independently find relevant test cases that exercise similar functionality. We developed a proof of concept TDR tool, called Reviver, that finds existing test cases exercising similar functions once given a new set of test cases. Using Reviver a developer writing tests for a new functionality can reuse or learn from similar functions developed in the past. We evaluated the effectiveness of Reviver in a controlled study using tasks and their manually generated approximations. We experimented with different configurations of Reviver and found that overall the combination of lexical and data flow similarity heuristics is more likely to find an existing implementation of the function under test. Our results confirm that lexical, structural, and data flow facts in the test cases exercising a function—in addition to the interface of function under test—improve selection of semantically relevant functions."],"dc:identifier.citation":["Nurolahzade, M. (2014). Test-Driven Reuse: Improving the Selection of Semantically Relevant Code (Doctoral thesis, University of Calgary, Calgary, Canada). Retrieved from https://prism.ucalgary.ca. doi:10.11575/PRISM/28000"],"dc:identifier.doi":["http://dx.doi.org/10.11575/PRISM/28000"],"dc:identifier.uri":["http://hdl.handle.net/11023/1428"],"dc:language.iso":["eng"],"dc:publisher.faculty":["Graduate Studies"],"dc:publisher.institution":["University of Calgary"],"dc:publisher.place":["Calgary"],"dc:rights":["University of Calgary graduate students retain copyright ownership and moral rights for their thesis. You may use this material in any way that is permitted by the Copyright Act or through licensing that has been assigned to the document. For uses that are not allowable under copyright legislation or licensing, you are required to seek permission."],"dc:subject":["Computer Science"],"dc:subject.classification":["Reuse","Test","Similarity"],"dc:title":["Test-Driven Reuse: Improving the Selection of Semantically Relevant Code"],"dc:type":["doctoral thesis"],"dspace:entity.type":["Publication"],"local:request.copy":["true"],"others:access_status":["open.access"],"thesis:degree_discipline":["Computer Science"],"thesis:degree_name":["Doctor of Philosophy (PhD)"],"thesis:institution_name":["University of Calgary"]},"updated_at":"2026-11-19T07:26:53Z"}