Analysis and Maintainability of Complex Industry Test Code Using Clone Detection

Public Deposited
Resource Type
Creator
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.

Subject
Language
Publisher
Thesis Degree Level
Thesis Degree Name
Thesis Degree Discipline
Identifier
Rights Notes
  • 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.

Date Created
  • 2020

Relations

In Collection:

Items