A Literature Review on Code Smells and Refactoring

Ruben Wangberg · NORA - Norwegian Open Research Archives · 2010

This thesis reports the results from a literature review conducted on the topic of code smells and refactoring. Code smells are segments of the source code that display potential design issues. Refactoring is the process for modifying source code to improve its quality (e.g. maintainability) without affecting its functionality. Improving the code design is important for reducing costs involved in maintenance projects. Thus, refactoring has become an integral part of developer’s everyday work, yet effects of refactoring on software quality are not well understood. I believe that an overview of the available empirical evidence on the effects of code smells and refactoring in software projects, as well as methods and tools available for supporting refactoring activities, will contribute significantly to the current practices in industry and at the same time, will provide a constructive stance towards scientific work within this field. This review was conducted on the three major databases related to software engineering: IEEE Xplore, ACM Digital Library and ISI Web of Knowledge, based on most of the features of a systematic literature review protocol. The main findings from this review are: A relatively small portion of the identified work reported empirical studies (24% of the articles) as opposed to design research contributions (61% of the articles), the latter includes both methods and tools for code smells detection and refactoring support. Only 13.8% of these design contributions reported any type of validation or evaluation in an industrial setting and of these, only half of them reported a thorough validation in a realistic setting (i.e. industrial). Most of the design contributions (22 out of 28) were partly or wholly concerned with the detection of code smells. The literature review identified several tools available to help developers detect and remove some code smells, but no significant evaluation was reported that could help to select the most suitable tool for a given context. The review found a significant increase in the number of publications on code smells and refactoring since 2005. Nevertheless, the review found in general a lack of empirically sound evidence that could help developers and architects interpreting, analyzing, and choosing the best refactoring strategies for improving maintainability. This leaves substantial areas for improvement within this area, mainly development of: (1) better and more concrete refactoring guidelines that are based on sound empirical evidence, and (2) better evaluation frameworks that could enable practitioners to choose the adequate tools and methods that would fit their specific needs in a given context.

Read the paper · More papers on PaperTik