School of Computing

Similar Code Detection and Elimination for Erlang Programs

Huiqing Li and Simon Thompson

In Manuel Carro and Ricardo Pena, editors, Practical Aspects of Declarative languages 2010, number 5937 in Lecture Notes in Computer Science, pages 182-196. Springer, January 2010.

Abstract

A well-known bad code smell in refactoring and software maintenance is duplicated code, that is the existence of code clones, which are code fragments that are identical or similar to one another. Unjustified code clones increase code size, make maintenance and comprehension more difficult, and also indicate design problems such as a lack of encapsulation or abstraction.

This paper describes an approach to detecting `similar' code based on the notion of anti-unification, or least-general common abstraction. This mechanism is used for detecting code clones in Erlang programs, and is supplemented by a collection of refactorings to support user-controlled automatic clone removal. The similar code detection algorithm and refactorings are integrated within Wrangler, a tool developed at the University of Kent for interactive refactoring of Erlang programs. We conclude with a report on case studies and comparisons with other tools.

Download publication 466 kbytes (PDF)

Bibtex Record

@inproceedings{2975,
author = {Huiqing Li and Simon Thompson},
title = {{Similar Code Detection and Elimination for Erlang Programs}},
month = {January},
year = {2010},
pages = {182-196},
keywords = {determinacy analysis, Craig interpolants},
note = {},
doi = {},
url = {http://www.cs.kent.ac.uk/pubs/2010/2975},
    publication_type = {inproceedings},
    submission_id = {26326_1263995519},
    ISBN = {978-3-642-11502-8},
    booktitle = {Practical Aspects of Declarative languages 2010},
    editor = {Manuel Carro and Ricardo Pena},
    number = {5937},
    series = {Lecture Notes in Computer Science},
    publisher = {Springer},
    refereed = {Yes},
}

School of Computing, University of Kent, Canterbury, Kent, CT2 7NF

Enquiries: +44 (0)1227 824180 or contact us.

Last Updated: 21/03/2014