Code refactoring using slice-based cohesion metrics and aspect-oriented programming. (2018) - Singh, Jagannath; Khilar, Pabitra Mohan; Mohapatra, Durga Prasad
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.