Skip to main content

The pragmatics of clone detection and elimination

Thompson, Simon, Li, Huiqing, Schumacher, Andreas (2017) The pragmatics of clone detection and elimination. The Art, Science, and Engineering of Programming, 1 (2). ISSN 2473-7321. (doi:10.22152/programming-journal.org/2017/1/8) (KAR id:61167)

PDF Publisher pdf
Language: English


Download (406kB) Preview
[thumbnail of 1703.10860.pdf]
Preview
This file may not be suitable for users of assistive technology.
Request an accessible format
Official URL
http://dx.doi.org/10.22152/programming-journal.org...

Abstract

The occurrence of similar code, or ‘code clones’, can make program code difficult to read, modify and maintain. This paper describes industrial case studies of clone detection and elimination, and were were performed in collaboration with engineers from Ericsson AB using the refactoring and clone detection tool Wrangler for Erlang.

We use the studies to illustrate the complex set of decisions that have to be taken when performing clone elimination in practice; we also discuss how the studies have informed the design of the tool. However, the conclusions we draw are largely language-independent, and set out the pragmatics of clone detection and elimination in real-world projects as well as design principles for clone detection decision-support tools.

Context. The context of this work is the fact that a software tool is designed to be used; the success of such a tool therefore depends on its suitability and usability in practice.

The work proceeds by observing the use of a tool in particular case studies in detail, through a “partici- pant observer” approach, and drawing qualitative conclusions from these studies, rather than collecting and analysing quantitative data from a larger set of applications. Our conclusions help not only programmers but also the designers of software tools.

Inquiry. Data collected in this way make two kinds of contribution. First, they provide the basis for deriving a set of questions that typically need to be answered by engineers in the process of removing clones from an application, and a set of heuristics that can be used to help answer these questions. Secondly, they provide feedback on existing features of software tools, as well as suggesting new features to be added to the tools.

Approach. The work was undertaken by the tool designers and engineers from Ericsson AB, working to- gether on clone elimination for code from the company.

Importance. The work gives guidelines that assist an engineer in using clone detection and elimination in practice, as well as helping a tool developer to shape their tool building. Although the work was in the context of a particular tool and programming language, the authors would argue that the high-level knowledge gained applies equally well to other notions of clone, as well as other tools and programming languages.

Item Type: Article
DOI/Identification number: 10.22152/programming-journal.org/2017/1/8
Projects: Projects 215868 not found.
Uncontrolled keywords: similar code, clone detection, clone elimination, clone removal, refactoring, testing, program comprehension, generalisation, strategy, Erlang, Wrangler, ProTest project
Subjects: Q Science > QA Mathematics (inc Computing science) > QA 76 Software, computer programming,
Divisions: Divisions > Division of Computing, Engineering and Mathematical Sciences > School of Computing
Depositing User: Simon Thompson
Date Deposited: 03 Apr 2017 06:16 UTC
Last Modified: 16 Feb 2021 13:44 UTC
Resource URI: https://kar.kent.ac.uk/id/eprint/61167 (The current URI for this page, for reference purposes)
Thompson, Simon: https://orcid.org/0000-0002-2350-301X
  • Depositors only (login required):

Downloads

Downloads per month over past year