Software refactoring at the class level using clustering techniques

Software becomes more and more complex as it adapts new requirements, is enhanced or is modified. Thus, the quality of the software decreases. Therefore, there is a need to reduce the software's complexity and improve its quality. Refactoring reduces software complexity and improves quality by restructuring the code into a more readable form that improves its internal structure without changing its external functionality. However, it is a challenging task and requires effort from the software designer. In this paper, we propose a method for identifying ill-structured software at the class level that provides heuristic refactoring advice to software designers in order to create balance between coupling and cohesion using pattern recognition techniques. To identify the illstructured code we use three clustering techniques, namely, the Single Linkage algorithm (SLINK), the Complete Linkage algorithm (CLINK) and the Weighted Pair-Group Method using Arithmetic averages (WPGMA). In addition to these clustering techniques, we also use the Adaptive K-Nearest Neighbour (A-KNN) algorithm and compare its performance with the other clustering techniques. The results show that software structuring at the class level using A-KNN is superior to SLINK, CLINK and WPGMA in terms of performance and computational complexity.

[1]  Tom Mens,et al.  A survey of software refactoring , 2004, IEEE Transactions on Software Engineering.

[2]  Sara J. Graves,et al.  An Empirical Study of Refactoring, New Design, and Error-Fix Efforts in Extreme Programming , 2001, ISAS-SCI.

[3]  David G. Stork,et al.  Pattern Classification , 1973 .

[4]  R. E. Kurt Stirewalt,et al.  Understanding interleaved code , 2004, Automated Software Engineering.

[5]  Peter J. Rousseeuw,et al.  Finding Groups in Data: An Introduction to Cluster Analysis , 1990 .

[6]  H. Charles Romesburg,et al.  Cluster analysis for researchers , 1984 .

[7]  Chung-Horng Lung,et al.  Applications of clustering techniques to software partitioning, recovery and restructuring , 2004, J. Syst. Softw..

[8]  Steve McConnell,et al.  Code complete - a practical handbook of software construction, 2nd Edition , 1993 .

[9]  Michael R. Anderberg,et al.  Cluster Analysis for Applications , 1973 .

[10]  Fionn Murtagh,et al.  A Survey of Recent Advances in Hierarchical Clustering Algorithms , 1983, Comput. J..

[11]  Wei Li,et al.  Another metric suite for object-oriented programming , 1998, J. Syst. Softw..

[12]  Chris F. Kemerer,et al.  A Metrics Suite for Object Oriented Design , 2015, IEEE Trans. Software Eng..

[13]  J. L. Hodges,et al.  Discriminatory Analysis - Nonparametric Discrimination: Consistency Properties , 1989 .

[14]  Ladan Tahvildari,et al.  A metric-based approach to enhance design quality through meta-pattern transformations , 2003, Seventh European Conference onSoftware Maintenance and Reengineering, 2003. Proceedings..

[15]  Oscar Nierstrasz,et al.  A meta-model for language-independent refactoring , 2000, Proceedings International Symposium on Principles of Software Evolution.

[16]  D. Defays,et al.  An Efficient Algorithm for a Complete Link Method , 1977, Comput. J..

[17]  Nicolas Anquetil,et al.  Comparative study of clustering algorithms and abstract representations for software remodularisation , 2003 .

[18]  Mohammad Alshayeb,et al.  Software refactoring at the package level using clustering techniques , 2011, IET Softw..

[19]  Chidchanok Lursinsap,et al.  Agglomerative hierarchical clustering for nonlinear data analysis , 2004, 2004 IEEE International Conference on Systems, Man and Cybernetics (IEEE Cat. No.04CH37583).

[20]  Brian Everitt,et al.  Cluster analysis , 1974 .

[21]  Anil K. Jain,et al.  Data clustering: a review , 1999, CSUR.

[22]  Roger S. Pressman,et al.  Software Engineering: A Practitioner's Approach , 1982 .

[23]  Chung-Horng Lung,et al.  Program restructuring using clustering techniques , 2006, J. Syst. Softw..

[24]  C. Lewerentz,et al.  Metrics based refactoring , 2001, Proceedings Fifth European Conference on Software Maintenance and Reengineering.

[25]  Timothy Lethbridge,et al.  Object-oriented software engineering - practical software development using UML and Java , 2002 .