Feature Toggle Usage Patterns : A Case Study on Google Chromium
Feature toggles control the state of features and allow exposing unfinished features to a reduced cohort of users without affecting the general software operation. It is basically a variable used in if conditions to control the flow of program execution. Since there is no universal standard of using feature toggles established yet, developers write code around feature toggles and use them spontaneously. Certain usage patterns of feature toggles may even lead to code smells. In this short paper we introduce six different toggle usage patterns from Google Chromium and discuss the possible reasons, consequences, and detection methods. We further conduct a mixed-method approach to analyze them. Since this study is still in progress, we report our early results only for the three most commonly appeared usage patterns. We validate our quantitative findings with the qualitative results obtained by interviewing 15 Google developers. We found that there are 3.1K toggles present in 38 components of Chromium. In the median case, nested toggles are shared by 5 different files, spread toggles span 2 different components, and dead toggles cover an average of 4 lines of code (loc). Novel aspects:- Although usage patterns of C pre-processors (#ifdef s) are studied in the past, we did not find any study particularly focusing on the run-time feature toggles usage patterns. Hence, we have been inspired to do an exploratory study to investigate different usage patterns of feature toggles. We chose Google Chromium as a case study at this point since Google developers use feature toggles extensively.
Tajmilur Rahman, PhD, is an assistant professor in the department of Computer and Information Science at Gannon University in Erie, Pennsylvania, United States. His overarching research interest is to investigate release engineering practices in software systems. His research works are driven by the desire to determine the empirical factors that lead to a successful software development and release. His research interests also include software engineering & data science, understanding the significance of software architecture for long lasting software systems, and providing tool support to the community to nurture software feature architecture. Dr. Rahman is the first author who extracted feature-architecture while understanding the best practices of feature management and its impact on software architecture, which is another major research interest of his. Understanding and visualizing feature architecture is necessary to advance software development and engineering by maintaining a controlled architectural growth of software systems. Dr. Rahman is currently focusing on the following research areas: software feature-architecture, release management, software quality prediction, in rapid-release, developing knowledge-base to predict potential architectural drift, software engineering education.
Dr. Rahman received his doctorate degree in 2018 from Concordia University. As a doctoral student he worked on empirical understanding on software projects with various lengths of release cycle, he extracted feature-architecture of Google Chrome web browser updated the 12 years old browser reference architecture and also he was working on software quality due to post-release bugs in a trunk based development environment.