{"id":{"repo_id":"carleton","oai_identifier":"oai:carleton.scholaris.ca:20.500.14718/41458"},"canonical_url":"https://search.ndltd.org/etd/carleton/oai:carleton.scholaris.ca:20.500.14718/41458","repository":{"repo_id":"carleton","name":"Carleton University","base_url":"https://carleton.scholaris.ca/server/oai/request"},"display":{"title":"Analysis and Maintainability of Complex Industry Test Code Using Clone Detection","abstract":"Many companies, including Ericsson, experience increased software verification costs. Agile cross-functional teams find it easy to make new additions of test cases for every change and fix. The consequence of this phenomenon is the duplications of test code, which is often referred to as code clone. In this thesis, we attempt to understand the prevalence of test code clones, thus contributing to the clone detection and software testing fields, and we then study how test code can be refactored to remove clones, therefore improving software testing activities. In this thesis, we aim to achieve the following goals. Firstly, we aim to detect clones in industry test codes. We found 49% of lines of code of the entire C test code are clones; We found 73% of lines of code of the entire Java test code is a clone. The results we report on in our study include figures about clone frequencies, types, similarity, size distributions, and number of line differences in cloned test cases. Secondly, following standard definitions of clone types, if the source code contains fragments that are in a Type-1 clone class, we theoretical argue and empirically confirm that those fragments belong to a Type-2 clone class; Such inclusions occur with Type-3 clone classes. When one relies on standard definitions of source code clone types, they are therefore running a risk of overlapping information being returned for different types of clone classes. This leads us to refine the standard terminology on clone types to avoid possible miss-interpretations of clone detection results and define and implement a Clone Reduction Procedure to remove overlapping clone detection information.We then use this tool infrastructure to empirically study the extent of overlapping information in clone detection results produced by NiCad. The third goal is to refactor test code clones. Refactoring is about restructuring and enhancing existing code without altering behaviour to improve maintainability. We aim to identify the clone tests that may appear to be good opportunities for refactoring test codes according to well defined or to be discovered test patterns so that refactored test code is easy to enhance, understand, and maintain.","abstract_html":"Many companies, including Ericsson, experience increased software verification costs. Agile cross-functional teams find it easy to make new additions of test cases for every change and fix. The consequence of this phenomenon is the duplications of test code, which is often referred to as code clone. In this thesis, we attempt to understand the prevalence of test code clones, thus contributing to the clone detection and software testing fields, and we then study how test code can be refactored to remove clones, therefore improving software testing activities. In this thesis, we aim to achieve the following goals. Firstly, we aim to detect clones in industry test codes. We found 49% of lines of code of the entire C test code are clones; We found 73% of lines of code of the entire Java test code is a clone. The results we report on in our study include figures about clone frequencies, types, similarity, size distributions, and number of line differences in cloned test cases. Secondly, following standard definitions of clone types, if the source code contains fragments that are in a Type-1 clone class, we theoretical argue and empirically confirm that those fragments belong to a Type-2 clone class; Such inclusions occur with Type-3 clone classes. When one relies on standard definitions of source code clone types, they are therefore running a risk of overlapping information being returned for different types of clone classes. This leads us to refine the standard terminology on clone types to avoid possible miss-interpretations of clone detection results and define and implement a Clone Reduction Procedure to remove overlapping clone detection information.We then use this tool infrastructure to empirically study the extent of overlapping information in clone detection results produced by NiCad. The third goal is to refactor test code clones. Refactoring is about restructuring and enhancing existing code without altering behaviour to improve maintainability. We aim to identify the clone tests that may appear to be good opportunities for refactoring test codes according to well defined or to be discovered test patterns so that refactored test code is easy to enhance, understand, and maintain.","abstract_has_math":false,"creators":["Hasanain, Wafa Othman Ahmad"],"institution":"Carleton University","degree_name":"Doctor of Philosophy (Ph.D.)","degree_level":"Doctoral","degree_discipline":"Engineering, Electrical and Computer","degree_department":null,"school":null,"contributors":[],"advisors":[],"committee_chairs":[],"committee_members":[],"year":2020,"date_issued":"2020","date_published":"2020","updated_at":"2026-11-19T07:10:41Z","subjects":["Computer science","System theory","System analysis","Electric networks"],"languages":["en"],"rights":["Copyright © 2020 the author(s). Theses may be used for non-commercial research, educational, or related academic purposes only. Such uses include personal study, research, scholarship, and teaching. Theses may only be shared by linking to Carleton University Institutional Repository and no part may be used without proper attribution to the author. No part may be used for commercial purposes directly or indirectly via a for-profit platform; no adaptation or derivative works are permitted without consent from the copyright owner."],"rights_urls":[],"identifier_entries":[{"key":"dc:identifier.doi","label":"DOI","values":["10.22215/etd/2020-14190"],"render_values":[{"text":"10.22215/etd/2020-14190","href":"https://doi.org/10.22215/etd/2020-14190","code":true}]}],"person_identifier_entries":[]},"links":{"outbound_url":"https://hdl.handle.net/20.500.14718/41458","outbound_label":"Handle","outbound_source":"dc:identifier.uri","record_url":"https://hdl.handle.net/20.500.14718/41458","record_label":"Repository record","record_kind":"handle","record_source":"dc:identifier.uri","download_url":null,"download_label":null,"download_source":null,"access_status":null,"embargo_until":null,"access_note":null},"source_record":{"url":"https://carleton.scholaris.ca/server/oai/request?verb=GetRecord&metadataPrefix=dim&identifier=oai%3Acarleton.scholaris.ca%3A20.500.14718%2F41458","prefix":"dim"},"metadata_groups":[{"id":"people","label":"People","entries":[{"key":"dc:creator","label":"Author","values":["Hasanain, Wafa Othman Ahmad"]}]},{"id":"academic_context","label":"Academic Context","entries":[{"key":"dc:date.accessioned","label":"Dc Date Accessioned","values":["2025-04-08T20:19:28Z"]},{"key":"dc:date.available","label":"Dc Date Available","values":["2025-04-08T20:19:28Z"]},{"key":"dc:date.issued","label":"Date","values":["2020"]},{"key":"dc:publisher","label":"Institution","values":["Carleton University"]},{"key":"dc:type","label":"Dc Type","values":["thesis"]},{"key":"thesis:degree_discipline","label":"Discipline","values":["Engineering, Electrical and Computer"]},{"key":"thesis:degree_level","label":"Degree Level","values":["Doctoral"]},{"key":"thesis:degree_name","label":"Degree Name","values":["Doctor of Philosophy (Ph.D.)"]}]},{"id":"subjects_keywords","label":"Subjects and Keywords","entries":[{"key":"dc:subject.lcsh","label":"Dc Subject Lcsh","values":["Computer science","System theory","System analysis","Electric networks"]}]},{"id":"language_rights","label":"Language and Rights","entries":[{"key":"dc:language.iso","label":"Language (ISO)","values":["en"]},{"key":"dc:rights","label":"Dc Rights","values":["Copyright © 2020 the author(s). Theses may be used for non-commercial research, educational, or related academic purposes only. Such uses include personal study, research, scholarship, and teaching. Theses may only be shared by linking to Carleton University Institutional Repository and no part may be used without proper attribution to the author. No part may be used for commercial purposes directly or indirectly via a for-profit platform; no adaptation or derivative works are permitted without consent from the copyright owner."]}]},{"id":"identifiers","label":"Identifiers","entries":[{"key":"dc:identifier.doi","label":"DOI","values":["10.22215/etd/2020-14190"]},{"key":"dc:identifier.uri","label":"Identifier URI","values":["https://hdl.handle.net/20.500.14718/41458"]}]},{"id":"additional","label":"Additional Metadata","entries":[{"key":"dc:description.abstract","label":"Abstract","values":["Many companies, including Ericsson, experience increased software verification costs. Agile cross-functional teams find it easy to make new additions of test cases for every change and fix. The consequence of this phenomenon is the duplications of test code, which is often referred to as code clone. In this thesis, we attempt to understand the prevalence of test code clones, thus contributing to the clone detection and software testing fields, and we then study how test code can be refactored to remove clones, therefore improving software testing activities. In this thesis, we aim to achieve the following goals. Firstly, we aim to detect clones in industry test codes. We found 49% of lines of code of the entire C test code are clones; We found 73% of lines of code of the entire Java test code is a clone. The results we report on in our study include figures about clone frequencies, types, similarity, size distributions, and number of line differences in cloned test cases. Secondly, following standard definitions of clone types, if the source code contains fragments that are in a Type-1 clone class, we theoretical argue and empirically confirm that those fragments belong to a Type-2 clone class; Such inclusions occur with Type-3 clone classes. When one relies on standard definitions of source code clone types, they are therefore running a risk of overlapping information being returned for different types of clone classes. This leads us to refine the standard terminology on clone types to avoid possible miss-interpretations of clone detection results and define and implement a Clone Reduction Procedure to remove overlapping clone detection information.We then use this tool infrastructure to empirically study the extent of overlapping information in clone detection results produced by NiCad. The third goal is to refactor test code clones. Refactoring is about restructuring and enhancing existing code without altering behaviour to improve maintainability. We aim to identify the clone tests that may appear to be good opportunities for refactoring test codes according to well defined or to be discovered test patterns so that refactored test code is easy to enhance, understand, and maintain."]},{"key":"dc:title","label":"Title","values":["Analysis and Maintainability of Complex Industry Test Code Using Clone Detection"]},{"key":"local:lac.licence","label":"Local Lac Licence","values":["true"]},{"key":"others:access_status","label":"Others Access Status","values":["open.access"]}]}],"canonical_facts":{"dc:creator":["Hasanain, Wafa Othman Ahmad"],"dc:date.accessioned":["2025-04-08T20:19:28Z"],"dc:date.available":["2025-04-08T20:19:28Z"],"dc:date.issued":["2020"],"dc:description.abstract":["Many companies, including Ericsson, experience increased software verification costs. Agile cross-functional teams find it easy to make new additions of test cases for every change and fix. The consequence of this phenomenon is the duplications of test code, which is often referred to as code clone. In this thesis, we attempt to understand the prevalence of test code clones, thus contributing to the clone detection and software testing fields, and we then study how test code can be refactored to remove clones, therefore improving software testing activities. In this thesis, we aim to achieve the following goals. Firstly, we aim to detect clones in industry test codes. We found 49% of lines of code of the entire C test code are clones; We found 73% of lines of code of the entire Java test code is a clone. The results we report on in our study include figures about clone frequencies, types, similarity, size distributions, and number of line differences in cloned test cases. Secondly, following standard definitions of clone types, if the source code contains fragments that are in a Type-1 clone class, we theoretical argue and empirically confirm that those fragments belong to a Type-2 clone class; Such inclusions occur with Type-3 clone classes. When one relies on standard definitions of source code clone types, they are therefore running a risk of overlapping information being returned for different types of clone classes. This leads us to refine the standard terminology on clone types to avoid possible miss-interpretations of clone detection results and define and implement a Clone Reduction Procedure to remove overlapping clone detection information.We then use this tool infrastructure to empirically study the extent of overlapping information in clone detection results produced by NiCad. The third goal is to refactor test code clones. Refactoring is about restructuring and enhancing existing code without altering behaviour to improve maintainability. We aim to identify the clone tests that may appear to be good opportunities for refactoring test codes according to well defined or to be discovered test patterns so that refactored test code is easy to enhance, understand, and maintain."],"dc:identifier.doi":["10.22215/etd/2020-14190"],"dc:identifier.uri":["https://hdl.handle.net/20.500.14718/41458"],"dc:language.iso":["en"],"dc:publisher":["Carleton University"],"dc:rights":["Copyright © 2020 the author(s). Theses may be used for non-commercial research, educational, or related academic purposes only. Such uses include personal study, research, scholarship, and teaching. Theses may only be shared by linking to Carleton University Institutional Repository and no part may be used without proper attribution to the author. No part may be used for commercial purposes directly or indirectly via a for-profit platform; no adaptation or derivative works are permitted without consent from the copyright owner."],"dc:subject.lcsh":["Computer science","System theory","System analysis","Electric networks"],"dc:title":["Analysis and Maintainability of Complex Industry Test Code Using Clone Detection"],"dc:type":["thesis"],"local:lac.licence":["true"],"others:access_status":["open.access"],"thesis:degree_discipline":["Engineering, Electrical and Computer"],"thesis:degree_level":["Doctoral"],"thesis:degree_name":["Doctor of Philosophy (Ph.D.)"]},"updated_at":"2026-11-19T07:10:41Z"}