|
ABSTRACT
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.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
J. Armstrong. Programming Erlang. Pragmatic Bookshelf, 2007.
|
| |
2
|
B. S. Baker. A Program for Identifying Duplicated Code. Computing Science and Statistics, 24:49--57, 1992.
|
| |
3
|
|
| |
4
|
|
 |
5
|
|
| |
6
|
|
| |
7
|
|
| |
8
|
M. Fowler. Refactoring: Improving the Design of Existing Code. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 1999. ISBN 0-201-48567-2.
|
| |
9
|
Y. Higo, T. Kamiya, S. Kusumoto, and K. Inoue. ARIES: Refactoring Support Environment Based on Code Clone Analysis. In IASTED Conf. on Software Engineering and Applications, pages 222--229, 2004.
|
| |
10
|
|
| |
11
|
|
| |
12
|
|
| |
13
|
|
| |
14
|
|
 |
15
|
|
| |
16
|
H. Li, S. Thompson, and C. Reinke. The Haskell Refactorer, HaRe, and its API. Electr. Notes Theor. Comput. Sci., 141(4):29--34, 2005.
|
| |
17
|
H. Li, S. Thompson, L. LÜovei, Z. Horváth, T. Kozsik, A. Víg, and T. Nagy. Refactoring Erlang Programs. In EUC'06, Stockholm, Sweden, November 2006a.
|
 |
18
|
Huiqing Li , Simon Thompson , George Orösz , Melinda Tóth, Refactoring with wrangler, updated: data and process refactorings, and integration with eclipse, Proceedings of the 7th ACM SIGPLAN workshop on ERLANG, September 27-27, 2008, Victoria, BC, Canada
[doi> 10.1145/1411273.1411283]
|
| |
19
|
|
| |
20
|
|
| |
21
|
|
| |
22
|
S. Peyton Jones, editor. Haskell 98 Language and Libraries: the Revised Report. Cambridge University Press, 2003. ISBN 0-521-82614-4.
|
| |
23
|
ProTest: property-based testing. http://www.protest-project.eu.
|
| |
24
|
C. H. Roy and R. Cordy. A Survey of Software Clone Detection Research. Technical report, School of Computing, Queen's University at Kingston, Ontario, Candada, 2007.
|
| |
25
|
K. Sagonas. Experience from Developing the Dialyzer: A Static Analysis Tool Detecting Defects In Erlang Applications. Presented at the ACM SIGPLAN Workshop on the Evaluation of Software Defect Detection Tools, 2005.
|
| |
26
|
D. Tsadok. ANSI C implementation of a Suffix Tree. Technical report, Computer-Science Department, Haifa University, Israel, August 2002.
|
| |
27
|
E. Ukkonen. On-Line Construction of Suffix Trees. Algorithmica, 14(3): 249--260, 1995.
|
| |
28
|
Yaws -- An Open Source Web Server Written in Erlang. http://yaws. hyber.org/.
|
INDEX TERMS
Primary Classification:
D.
Software
D.2
SOFTWARE ENGINEERING
D.2.3
Coding Tools and Techniques
Additional Classification:
D.
Software
D.2
SOFTWARE ENGINEERING
D.2.7
Distribution, Maintenance, and Enhancement
D.3
PROGRAMMING LANGUAGES
D.3.2
Language Classifications
Subjects:
Applicative (functional) languages;
Concurrent, distributed, and parallel languages
General Terms:
Design,
Languages
Keywords:
duplicated code,
erlang,
program analysis,
program transformation,
refactoring,
wrangler
|