Title: Code refactoring using slice-based cohesion metrics and aspect-oriented programming

Authors: Jagannath Singh; Pabitra Mohan Khilar; Durga Prasad Mohapatra

Addresses: Department of Computer Science and Engineering, National Institute of Technology, Rourkela, Orissa, India ' Department of Computer Science and Engineering, National Institute of Technology, Rourkela, Orissa, India ' Department of Computer Science and Engineering, National Institute of Technology, Rourkela, Orissa, India

Abstract: Software restructuring is essential for maintaining software quality. It is a usual practice that we first design the software and then go for coding. After coding, if there is any change in the requirement or if the output is incorrect, then we have to modify the code again. For each small code modification, it is not feasible to alter the design. These minor changes made to the code causes decay in the software design. Software refactoring is used to restructure the code to improve the design and quality of the software. In this paper, we propose an approach for performing code refactoring. We use slice-based cohesion metrics to identify the target methods that require refactoring. After identifying the target methods, we use program slicing to divide the target method into two parts. Finally, we use the concept of aspects to alter the code structure in a manner that does not change the external behaviour of the original module.

Keywords: software refactoring; program slicing; AOP; cohesion metrics; code restructure; AspectJ.

DOI: 10.1504/IJBIS.2018.088570

International Journal of Business Information Systems, 2018 Vol.27 No.1, pp.45 - 68

Received: 13 Mar 2016
Accepted: 21 Jun 2016

Published online: 12 Dec 2017 *

Full-text access for editors Full-text access for subscribers Purchase this article Comment on this article