TY - JOUR
T1 - Role stereotypes in software designs and their evolution
AU - Ho-Quang, Truong
AU - Nurwidyantoro, Arif
AU - Rukmono, Satrio Adi
AU - Chaudron, Michel R.V.
AU - Fröding, Fabian
AU - Ngoc, Duy Nguyen
N1 - Publisher Copyright:
© 2022 Elsevier Inc.
PY - 2022/7
Y1 - 2022/7
N2 - Role stereotypes are abstract characterisations of the responsibilities of the building blocks of software applications. The role a class plays within a software system reflects its design intention. Wirfs-Brock introduced the following six role stereotypes: Information Holder, which knows information, Structurer, which maintains object relationships, Service Provider, which offers computing services, Coordinator, which delegates tasks to others, Controller, which directs other's actions, and Interfacer, which transforms information. Knowledge about class role stereotypes can help various software development and maintenance tasks, such as program understanding, program summarisation, and quality assurance. This paper presents an automated machine learning-based approach for classifying the role-stereotype of classes in Java projects. We analyse this approach's performance against a manually labelled ground truth for three open source projects that contain 1,500+ Java classes altogether. The contributions of this paper include: (i) a machine learning (ML) approach to address the problem of automatically inferring role-stereotypes of classes in Object-Oriented Programming Languages, (ii) the manually labelled ground truth, (iii) an evaluation of the performance of the classifier, (iv) an evaluation of the generalisability of the approach, and (v) an illustration of new uses of role-stereotypes. The evaluation shows that the Random Forest algorithm yields the best classification performance. We find, however, that the performance of the ML-classifier varies a lot for different role stereotypes. In particular, its performance degrades when classifying rarer stereotypes. Among the 23 features that we study, features related to the classes’ collaboration characteristics and complexity stand out as the best discriminants of role stereotypes.
AB - Role stereotypes are abstract characterisations of the responsibilities of the building blocks of software applications. The role a class plays within a software system reflects its design intention. Wirfs-Brock introduced the following six role stereotypes: Information Holder, which knows information, Structurer, which maintains object relationships, Service Provider, which offers computing services, Coordinator, which delegates tasks to others, Controller, which directs other's actions, and Interfacer, which transforms information. Knowledge about class role stereotypes can help various software development and maintenance tasks, such as program understanding, program summarisation, and quality assurance. This paper presents an automated machine learning-based approach for classifying the role-stereotype of classes in Java projects. We analyse this approach's performance against a manually labelled ground truth for three open source projects that contain 1,500+ Java classes altogether. The contributions of this paper include: (i) a machine learning (ML) approach to address the problem of automatically inferring role-stereotypes of classes in Object-Oriented Programming Languages, (ii) the manually labelled ground truth, (iii) an evaluation of the performance of the classifier, (iv) an evaluation of the generalisability of the approach, and (v) an illustration of new uses of role-stereotypes. The evaluation shows that the Random Forest algorithm yields the best classification performance. We find, however, that the performance of the ML-classifier varies a lot for different role stereotypes. In particular, its performance degrades when classifying rarer stereotypes. Among the 23 features that we study, features related to the classes’ collaboration characteristics and complexity stand out as the best discriminants of role stereotypes.
KW - Class role-stereotypes
KW - Design metrics
KW - Machine learning classification
KW - Program analysis
KW - Software engineering
UR - http://www.scopus.com/inward/record.url?scp=85126864001&partnerID=8YFLogxK
U2 - 10.1016/j.jss.2022.111296
DO - 10.1016/j.jss.2022.111296
M3 - Article
AN - SCOPUS:85126864001
SN - 0164-1212
VL - 189
JO - Journal of Systems and Software
JF - Journal of Systems and Software
M1 - 111296
ER -