Skip to main content

Similar Code Detection and Elimination for Erlang Programs

Li, Huiqing and Thompson, Simon (2010) Similar Code Detection and Elimination for Erlang Programs. In: Carro, Manuel and Pena, Ricardo, eds. Practical Aspects of Declarative Languages 12th International Symposium. Lecture Notes in Computer Science . Springer, Berlin, Germany, pp. 182-196. ISBN 978-3-642-11502-8. E-ISBN 978-3-642-11503-5. (doi:10.1007/978-3-642-11503-5_10) (KAR id:30703)

Language: English
Download (477kB)
[thumbnail of PADL10.pdf]
This file may not be suitable for users of assistive technology.
Request an accessible format
Official URL:


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.

Item Type: Book section
DOI/Identification number: 10.1007/978-3-642-11503-5_10
Uncontrolled keywords: determinacy analysis, Craig interpolants
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: S. Thompson
Date Deposited: 21 Sep 2012 09:49 UTC
Last Modified: 16 Nov 2021 10:08 UTC
Resource URI: (The current URI for this page, for reference purposes)
Thompson, Simon:
  • Depositors only (login required):


Downloads per month over past year