The Role of Duplicated Code in Software Readability and Comprehension

University essay from Blekinge Tekniska Högskola/Institutionen för programvaruteknik

Abstract: Background. Readability and comprehension are the critical points of software developmentand maintenance. There are many researcher point out that the duplicatecode as a code smell has effect on software maintainability, but lack of research abouthow duplicate code affect software readability and comprehension, which are parts of maintainability. Objectives. In this thesis, we aim to briefly summarize the impact of duplicatecode and typical types of duplicate code according to current works, then our goalis to explore whether duplicate code is a factor to influence readability and comprehension. Methods. In our present research, we did a background survey to asked some background questions from forty-two subjects to help us classify them, and conduct an experiment with subjects to explore the role of duplicate code on perceived readability and comprehension by experiment. The perceived readability and comprehension are measured by perceived readability scale, reading time and the accuracy of cloze test. Results. The experimental data shows code with duplication have higher perceived readability and better comprehension, however, the difference are not significant.And code with duplication cost less reading time than code without duplication,and the difference is significant. But duplication type are strongly associate with perceived readability. For reading time, it is significant associate with duplication type and size of code. While there do not exists significant correlation between programmingexperience of subjects and perceived readability or comprehension, andit also has no significant relation between perceived readability and comprehension,size and CC according to our data results. Conclusions. Code with duplication has higher software readability according tothe results of reading time, which is significant. And code with duplication has highercomprehension than code without duplication, but the difference is not statistically significant according to our experimental results. Longer size of code will increasereading time, and different duplication type also influence the perceived readability,the three duplication types we discussed show these relationship obviously.

  AT THIS PAGE YOU CAN DOWNLOAD THE WHOLE ESSAY. (follow the link to the next page)