DocumentCode
2139713
Title
Analyzing the Effect of Preprocessor Annotations on Code Clones
Author
Schulze, Sandro ; Jürgens, Elmar ; Feigenspan, Janet
Author_Institution
Univ. of Magdeburg, Magdeburg, Germany
fYear
2011
fDate
25-26 Sept. 2011
Firstpage
115
Lastpage
124
Abstract
The C preprocessor cpp is a powerful and language-independent tool, widely used to implement variable software in different programming languages (C, C++) using conditional compilation. Preprocessor annotations can used on different levels of granularity such as functions or statements. In this paper, we investigate whether there is a relation between code clones and preprocessor annotations. Specifically, we address the question whether the discipline of annotation has an effect on code clones. To this end, we perform a case study on fifteen different C programs and analyze them regarding code clones and #ifdef occurrences. We found only minor effects of annotations on code clones, but a relationship between annotations that align with the code structure (and code clones). With this work, we provide new insights why code clones occur in C programs. Furthermore, the results can support the decision whether or not it is beneficial to remove clones.
Keywords
C language; program compilers; #ifdef occurrences; C preprocessor; C programs; code clones; cpp; language independent tool; preprocessor annotations; variable software; Algorithm design and analysis; Cloning; Programming; Software systems; Synchronization; XML; C preprocessor; code clones; empirical study; software maintenance;
fLanguage
English
Publisher
ieee
Conference_Titel
Source Code Analysis and Manipulation (SCAM), 2011 11th IEEE International Working Conference on
Conference_Location
Williamsburg, VI
Print_ISBN
978-1-4577-0932-6
Type
conf
DOI
10.1109/SCAM.2011.12
Filename
6065170
Link To Document