Location of Repository

Clone Detection and Removal for Erlang/OTP within a Refactoring Environment

By Huiqing Li and Simon Thompson


A well-known bad code smell in refactoring and software maintenance is duplicated code, or code clones. A code clone is a code fragment that is identical or similar to another. Unjustified code clones increase code size, make maintenance and comprehension more difficult, and also indicate design problems such as lack of encapsulation or abstraction. This paper proposes a token and AST based hybrid approach to automatically detecting code clones in Erlang/OTP programs, underlying a collection of refactorings to support user-controlled automatic clone removal, and examines their application in substantial case studies. Both the clone detector and the refactorings are integrated within Wrangler, the refactoring tool developed at Kent for Erlang/OTP

Topics: QA76
Year: 2009
OAI identifier: oai:kar.kent.ac.uk:24061

Suggested articles



  1. (2003). 98 Language and Libraries: the Revised Report.
  2. (1999). A language independent approach for detecting duplicated code. doi
  3. (2002). ANSI C implementation of a Suffix Tree.
  4. (2002). CCFinder: A Multi-Linguistic Token-based Code Clone Detection System for Large Scale Source Code. doi
  5. (2006). Clone Detection Using Abstract Syntax Suffix Trees. doi
  6. (1998). Clone Detection Using Abstract Syntax Trees. doi
  7. (2006). Clones Considered Harmful” Considered Harmful. doi
  8. (2006). Cp-miner: Finding copy-paste and related bugs in large-scale software code. doi
  9. (2007). Deckard: Scalable and accurate tree-based detection of code clones. doi
  10. (2005). Detecting higher-level similarity patterns in programs. doi
  11. (2005). Experience from Developing the Dialyzer: A Static Analysis Tool Detecting Defects In Erlang Applications.
  12. (1998). Mnesia - a distributed robust dbms for telecommunications applications. In doi
  13. (1995). On Finding Duplication and Near-Duplication in Large Software Systems. doi
  14. (1995). On-Line Construction of Suffix Trees. doi
  15. (1999). Partial Redesign of Java Software Systems Based on Clone Analysis. doi
  16. (2007). Programming Erlang. Pragmatic Bookshelf, doi
  17. (2006). Refactoring Erlang Programs.
  18. (2008). Refactoring with Wrangler, updated. doi
  19. (1999). Refactoring: Improving the Design of Existing Code. doi
  20. (2002). Software Quality Analysis by Code Clones in Industrial Legacy Software. doi
  21. (2005). The Haskell Refactorer, HaRe, and its API. doi
  22. (2001). Tool Demonstration: Finding Duplicated Code Using Program Dependences. doi

To submit an update or takedown request for this paper, please submit an Update/Correction/Removal Request.