Title
Development nature matters: An empirical study of code clones in JavaScript applications
Abstract
Code cloning is one of the active research areas in the software engineering community. Specifically, researchers have conducted numerous empirical studies on code cloning and reported that 7 % to 23 % of the code in a typical software system has been cloned. However, there was less awareness of code clones in dynamically-typed languages and most studies are limited to statically-typed languages such as Java, C, and C++. In addition, most previous studies did not consider different application domains such as standalone projects or web applications. As a result, very little is known about clones in dynamically-typed languages, such as JavaScript, in different application domains. In this paper, we report a large-scale clone detection experiment in a dynamically-typed programming language, JavaScript, for different application domains: web pages and standalone projects. Our experimental results showed that unlike JavaScript standalone projects, JavaScript web applications have 95 % of inter-file clones and 91–97 % of widely scattered clones. We observed that web application developers created clones intentionally and such clones may not be as risky as claimed in previous studies. Understanding the risks of cloning in web applications requires further studies, as cloning may be due to either good or bad intentions. Also, we identified unique development practices such as including browser-dependent or device-specific code in code clones of JavaScript web applications. This indicates that features of programming languages and technologies affect how developers duplicate code.
Year
DOI
Venue
2016
10.1007/s10664-015-9368-6
Empirical Software Engineering
Keywords
Field
DocType
JavaScript,Code clones,Web applications,Clone properties,Software metrics,Cloning patterns
Duplicate code,World Wide Web,Programming language,Web page,Computer science,Unobtrusive JavaScript,Software system,Software metric,Web application,Java,JavaScript
Journal
Volume
Issue
ISSN
21
2
1382-3256
Citations 
PageRank 
References 
9
0.45
89
Authors
3
Name
Order
Citations
PageRank
wai ting cheung190.45
Sukyoung Ryu218525.77
Sunghun Kim33036114.11