Towards the Characterization of Monitor Smells in Adaptive Systems - Serikawa, Marcel A.; Landi, André de S.; Siqueira, Bento R.; Costa, Renato S.; Ferrari, Fabiano C.; Menotti, Ricardo; Camargo, Valter V. De (Anais do Simpósio Brasileiro de Componentes, Arquiteturas e Reutilização de Software (SBCARS); 2016: Anais do X Simpósio Brasileiro de Componentes, Arquiteturas e Reutilização de Software, 2016)
Adaptive Systems (ASs) can adapt themselves to achanging environment or new user needs. Monitors are essential in AS, being responsible for collecting and processing data from environment. There exist different kinds of monitors with distinct characteristics. Based on a literature review, we have noticed that Monitors are usually designed and implemented in an inadequate way: i) making them obscure in the source-code, ii) compelling all of them to have the same polling rate and also iii) predetermining the execution order among them. This leads to maintenance, evolution and performance problems. Besides, based on our observations, this erroneous way monitors are implemented follows a pattern and it is a recurrent practice. Therefore, we believe it can be classified as Monitor Smells of Adaptive Systems. In this paper we present two architectural smells we have identified: the Obscure Monitor and the Oppressed Monitors. The first smell occurs when the monitors are not evident in the source-code. The second smell occurs when monitors are compelled to have the same poling rate and an immutable execution order at runtime. The presence of these smells compromises the reusability, evolvability and maintainability. We have also conducted an exploratory study by comparing the impact of maintenance tasks in the original version of an AS called PhoneAdapter with a refactored version, in which the smells were removed. The results indicate the maintenance is facilitated in the version without the smells.