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. Lecture Notes in Computer Science (5937). Springer pp. 182-196. ISBN 978-3-642-11502-8. (Full text available)


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: Conference or workshop item (UNSPECIFIED)
Uncontrolled keywords: determinacy analysis, Craig interpolants
Subjects: Q Science > QA Mathematics (inc Computing science) > QA 76 Software, computer programming,
Divisions: Faculties > Sciences > School of Computing > Programming Languages and Systems Group
Depositing User: Simon Thompson
Date Deposited: 21 Sep 2012 09:49 UTC
Last Modified: 22 Aug 2014 16:15 UTC
Resource URI: (The current URI for this page, for reference purposes)
  • Depositors only (login required):


Downloads per month over past year