Using machine learning to understand the association of design smells with role-stereotypes in software systems
Abstract
While developing software systems, poor design and implementation choices can negatively affect the maintainability of software systems. There are recurring patterns of poorly designed (fragments of) software systems - these are referred to as design smells. Role-stereotypes indicate generic responsibilities that classes play in system design. Although the concepts of role-stereotypes and design smells are widely divergent, both are significant contributors to the design and maintenance of software systems. This work presents an exploratory study approach based on a combination of statistical analysis and unsupervised learning methods to understand the relation between design smells with role-stereotypes and how this relationship varies across different desktop and mobile applications. The study was performed on a dataset consisting of twelve (12) Java projects mined from GitHub. The findings indicate that three (3) out of six (6) role-stereotypes considered in this study are more prone to design smells. In addition, we found that design smells are more frequent in desktop applications than in mobile applications especially the Service Provider and Information Holder role-stereotypes. Based on unsupervised learning, it was observed that some pairs or groups of role-stereotypes are prone to similar types of design smells as compared to others. We believe that this relationship may be associated with the characteristic and collaborative properties between role-stereotypes. Additionally, the aforementioned clustering technique revealed which groups of design smells often co-occur. Specifically, {SpeculativeGenerality, Swis-sArmyKnife} and {LongParameterList, ClassDataShouldBePrivate} are observed to occur frequently together in desktop and mobile applications. Therefore, this study provides important insights on this previously concealed behaviour about the relation between design smells with role-stereotypes.