Reengineering an Adaptive System to Dynamic Software Product Lines: An Experience report
Abstract
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.
References
Mahdi Bashari, Ebrahim Bagheri, and Weichang Du. 2017. Dynamic software product line engineering: a reference framework. International Journal of Software Engineering and Knowledge Engineering 27, 02 (2017), 191–234.
Davide Basile, Maurice H Ter Beek, Felicita Di Giandomenico, and Stefania Gnesi. 2017. Orchestration of dynamic service product lines with featured modal contract automata. In Proceedings of the 21st International Systems and Software Product Line Conference-Volume B. 117–122.
Nelly Bencomo, Peter Sawyer, Gordon S Blair, and Paul Grace. 2008. Dynamically adaptive systems are product lines too: using model-driven techniques to capture dynamic variability of adaptive systems.. In SPLC (2). 23–32.
Gunnar Brataas, Svein Olav Hallsteinsen, Romain Rouvoy, and Frank Eliassen. 2007. Scalability of decision models for dynamic product lines. In 11th International Conference, SPLC 2007, Kyoto, Japan, September 10-14, 2007.
Denivan Campos, Luana Martins, Joselito Mota, Dhyego Tavares, Jander Pereira, Mayki Oliveira, Denis Boaventura, Diego Correa, Eduardo Ferreira, George Pinto, et al. 2024. Designing, Implementing, and Testing AI-Oriented Smart Home Applications: Challenges and Best Practices. In European Conference on Software Architecture. Springer, 83–99.
Michelle Larissa Luciano Carvalho, Matheus Lessa Goncalves Da Silva, Gecynalda Soares da Silva Gomes, Alcemir Rodrigues Santos, Ivan do Carmo Machado, Magno Luã de Jesus Souza, and Eduardo Santana de Almeida. 2018. On the implementation of dynamic software product lines: An exploratory study. Journal of Systems and Software 136 (2018), 74–100.
Carlos Cetina, Pau Giner, Joan Fons, and Vicente Pelechano. 2009. Using feature models for developing self-configuring smart homes. In 2009 Fifth International Conference on Autonomic and Autonomous Systems. IEEE, 179–188.
Padma Nyoman Crisnapati, I Nyoman KusumaWardana, and I Komang Agus Ady Aryanto. 2016. Rudas: Energy and sensor devices management system in home automation. In 2016 IEEE region 10 symposium (TENSYMP). IEEE, 184–187.
Diego Corrêa da Silva, Denis Robson Dantas Boaventura, Mayki dos Santos Oliveira, Jander Pereira Santos Junior, Eduardo Ferreira da Silva, Eduardo Santana de Almeida, Cássio VS Prazeres, Ivan do Carmo Machado, Maycon Leone Maciel Peixoto, Gustavo Bittencourt Figueiredo, et al. 2025. Evaluating Multi-Label Machine Learning Models for Smart Home Environments. Software: Practice and Experience (2025).
Mayki dos Santos Oliveira, Denis Robson Dantas Boaventura, Eduardo Ferreira Da Silva, Joel Machado Pires, Isaque Santana Copque, Bruno Pereira dos Santos, Ivan do Carmo Machado, Cássio Vinicius Serafim Prazeres, Maycon Leone Maciel Peixoto, Gustavo Bittencourt Figueiredo, et al. 2025. HESTIA: A Home Environment Simulator Targeting Inhabitant Activities. Authorea Preprints (2025).
Stefan Fischer, Gabriela Karoline Michelon, Wesley KG Assunção, Rudolf Ramler, and Alexander Egyed. 2023. Designing a Test Model for a Configurable System: An Exploratory Study of Preprocessor Directives and Feature Toggles. In Proceedings of the 17th International Working Conference on Variability Modelling of Software-Intensive Systems. 31–39.
Flagsmith. 2024. Flagsmith: Open-source Feature Flags and Remote Config. [link] Accessed: 2024-12-11.
Martin Fowler. [n. d.]. Feature Flag. [link]
Hendrik Göttmann, Lars Luthmann, Malte Lochau, and Andy Schürr. 2020. Realtime-aware reconfiguration decisions for dynamic software product lines. In Proceedings of the 24th ACM Conference on Systems and Software Product Line: Volume A-Volume A. 1–11.
GrowthBook. 2024. GrowthBook: Open-source Feature Flagging and Experimentation. [link] Accessed: 2024-12-11.
Raj Jain. 1991. The Art of Computer Systems Performance Analysis. John Wiley & Sons.
Jean-Marc Jézéquel, Jörg Kienzle, and Mathieu Acher. 2022. From feature models to feature toggles in practice. In Proceedings of the 26th ACM International Systems and Software Product Line Conference-Volume A. 234–244.
Joselito Jr, Luana Martins, Dhyego Tavares, Denivan Campos, Frederico Durão, Cássio Prazeres, Maycon Peixoto, Gustavo Figueiredo, Ivan Machado, and Eduardo Almeida. 2024. Unleashing the Future of Smart Homes: A Revelation of Cutting-Edge Distributed Architecture. In Anais do XVIII Simpósio Brasileiro de Componentes, Arquiteturas e Reutilização de Software (Curitiba/PR). SBC, Porto Alegre, RS, Brasil, 41–50. DOI: 10.5753/sbcars.2024.3854
LaunchDarkly. 2024. LaunchDarkly: Feature Flags as a Service. [link] Accessed: 2024-12-11.
Rezvan Mahdavi-Hezaveh, Nirav Ajmeri, and Laurie Williams. 2022. Feature toggles as code: Heuristics and metrics for structuring feature toggles. Information and Software Technology 145 (2022), 106813.
Rezvan Mahdavi-Hezaveh, Jacob Dremann, and Laurie Williams. 2021. Software development with feature toggles: practices used by practitioners. Empirical Software Engineering 26 (2021), 1–33.
Rezvan Mahdavi-Hezaveh, Sameeha Fatima, and Laurie Williams. 2024. Paving a Path for a Combined Family of Feature Toggle and Configuration Option Research. ACM Trans. Softw. Eng. Methodol. 33, 7, Article 172 (Sept. 2024), 27 pages. DOI: 10.1145/3672555
Luana Martins, Denivan Campos, Joselito Mota, Dhyego Tavares, Jander Pereira, Mayki Oliveira, Denis Boaventura, Diego Correa, Eduardo Ferreira, George Pinto, et al. 2024. A Case Study of Smart Home Development. IEEE Software (2024).
Ethan T McGee and John D McGregor. 2017. A realization effort estimation model for dynamic software product lines. In Proceedings of the 21st International Systems and Software Product Line Conference-Volume B. 111–116.
Holt Mebane and Joni T Ohta. 2007. Dynamic complexity and the Owen firmware product line program. In 11th International Software Product Line Conference (SPLC 2007). IEEE, 212–222.
Jens Meinicke, Juan Hoyos, Bogdan Vasilescu, and Christian Kästner. 2020. Capture the feature flag: Detecting feature flags in open-source. In Proceedings of the 17th International Conference on Mining Software Repositories. 169–173.
Jens Meinicke, Chu-Pan Wong, Bogdan Vasilescu, and Christian Kästner. 2020. Exploring differences and commonalities between feature flags and configuration options. In Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering: Software Engineering in Practice. 233–242.
Bruno Iizuka Moritani and Jaejoon Lee. 2017. An approach for managing a distributed feature model to evolve self-adaptive dynamic software product lines. In Proceedings of the 21st International Systems and Software Product Line Conference-Volume B. 107–110.
Juliana Alves Pereira, Sandro Schulze, Eduardo Figueiredo, and Gunter Saake. 2018. N-dimensional tensor factorization for self-configuration of software product lines at runtime. In Proceedings of the 22nd International Systems and Software Product Line Conference-Volume 1. 87–97.
PostHog. 2024. PostHog: Product Analytics and Feature Flags. [link] Accessed: 2024-12-11.
Md Tajmilur Rahman, Louis-Philippe Querel, Peter C Rigby, and Bram Adams. 2016. Feature toggles: practitioner practices and a case study. In Proceedings of the 13th international conference on mining software repositories. 201–211.
Cosmin-Ioan Roşu and Mihai Togan. 2023. A Modern Paradigm for Effective Software Development: Feature Toggle Systems. In 2023 15th International Conference on Electronics, Computers and Artificial Intelligence (ECAI). IEEE, 1–6.
Split.io. 2024. Split.io: Feature Flags and Experimentation. [link] Accessed: 2024-12-11.
Dhyego Tavares, Erlon P. Almeida, Jander P. S. Junior, Felipe S. A. Paixão, Enio G. Santana Jr., Rodrigo R. G. Souza, Frederico A. Durão, Cássio V. S. Prazeres, Ivan C. Machado, Gustavo B. Figueiredo, Maycon L. M. Peixoto, Hérsio M. Iwamoto, and Eduardo Santana de Almeida. 2024. Software Development Practices and Tools for University-Industry R&D Projects. In XXIII Brazilian Symposium on Software Quality (SBQS 2024), November 5–8, 2024, Salvador, Brazil. ACM, Salvador, Brazil. DOI: 10.1145/3701625.3701627 Proceedings of the XXIII Brazilian Symposium on Software Quality (SBQS 2024), November 5–8, 2024.
Pablo Trinidad, Antonio Ruiz Cortés, Joaquin Pena, and David Benavides. 2007. Mapping Feature Models onto Component Models to Build Dynamic Software Product Lines.. In SPLC (2). 51–56.
Unleash. 2024. Unleash: Open-source feature management. [link] Accessed: 2024-12-11.
Markus Weckesser, Roland Kluge, Martin Pfannemüller, Michael Matthé, Andy Schürr, and Christian Becker. 2018. Optimal reconfiguration of dynamic software product lines based on performance-influence models. In Proceedings of the 22nd International Systems and Software Product Line Conference-Volume 1. 98–109.
DannyWeyns,MUsman Iftikhar, Sam Malek, and Jesper Andersson. 2012. Claims and supporting evidence for self-adaptive systems: A literature study. In 2012 7th International Symposium on Software Engineering for Adaptive and Self-Managing Systems (SEAMS). IEEE, 89–98.
Claes Wohlin. 2014. Guidelines for snowballing in systematic literature studies and a replication in software engineering. In Proceedings of the 18th international conference on evaluation and assessment in software engineering. 1–10.
