Role stereotypes in software designs and their evolution
Journal article, 2022

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.

Class role-stereotypes

Design metrics

Program analysis

Machine learning classification

Software engineering

Author

Truong Ho-Quang

Chalmers, Computer Science and Engineering (Chalmers), Software Engineering (Chalmers)

Arif Nurwidyantoro

Monash University

Satrio Adi Rukmono

Institut Teknologi Bandung

Eindhoven University of Technology

Michel Chaudron

University of Gothenburg

Eindhoven University of Technology

Fabian Fröding

University of Gothenburg

Duy Nguyen Ngoc

University of Gothenburg

Journal of Systems and Software

0164-1212 (ISSN)

Vol. 189 111296

Subject Categories

Other Computer and Information Science

Information Science

Information Systemes, Social aspects

DOI

10.1016/j.jss.2022.111296

More information

Latest update

4/7/2022 1