Reengineering an Adaptive System to Dynamic Software Product Lines: An Experience report - Cruz, Dhyego Tavares M. da; Seixas, Nilton F. S.; Oliveira, Mayki dos Santos; Freire, Marcus Elias Silva; Souza, Rodrigo R. G.; Durão, Frederico A.; Prazeres, Cássio V. S.; Machado, Ivan do Carmo; Figueiredo, Gustavo B.; Peixoto, Maycon L. M.; Iwamoto, Hérsio Massanori; Almeida, Eduardo Santana de (Anais do Simpósio Brasileiro de Componentes, Arquiteturas e Reutilização de Software (SBCARS), 2025)
Dynamic Software Product Lines (DSPLs) extend traditional Software Product Lines by enabling runtime adaptation through predefined variability points. Despite their benefits, the migration of legacy or adaptive systems to DSPLs remains underexplored, especially through the use of feature toggles. This study aims to investigate how an adaptive AI-based smart home system can be refactored into a DSPL using feature toggles to manage runtime variability and improve modularity, flexibility, and performance. The research involved (i) a literature review on DSPLs and feature toggle strategies, (ii) the creation of feature models from code analysis, documentation, and expert interviews, and (iii) the incremental implementation of 13 feature toggles across three system modules (RecSys, ChatBot, Vision). Two experiments using factorial design were conducted to assess the impact on performance metrics. The refactored system demonstrated improved adaptability and reduced resource usage without performance degradation. Feature toggles enabled real-time activation/deactivation of functionalities, allowing for user-specific configurations and subscription models. However, limitations were found in toggle dependency management, requiring manual coding solutions. Feature toggles proved to be an effective and practical strategy for transforming an adaptive system into a DSPL, enhancing runtime flexibility and system evolution capabilities. The study highlights key considerations for managing toggles, such as modularization, architectural process, and the importance of documentation.