links:: feature toggles MOC

Feature Toggles Slides



Feature toggles/flags

Software development technique that allows developers to turn on or off certain features or functionalities of an application without changing the codebase

safer and more frequent deployments

facilitate testing

gathering feedback on new features

release new features to a small group of users

test different variations of a feature

manage technical debt

easier to maintain and update an application over time

Why Feature Toggles?

Conditional statement

if ( featureFlagEnabled) {

  // execute code for feature

} else {

  // execute default code


How Feature Flags Work

Toggle configuration control

img/WYWM_2023_Presentation_Feature_Toggles_Maksim Zinovev3.png|500


WYWM_2023_Presentation_Feature_Toggles_Maksim Zinovev5.jpg|500

Benefits of Feature Flags


Categories of Toggles

img/WYWM_2023_Presentation_Feature_Toggles_Maksim Zinovev11.png|500


… enable trunk-based development for teams practicing Continuous Delivery. They allow in-progress features to be checked into a shared integration branch (e.g. master or trunk) while still allowing that branch to be deployed to production at any time.

Release Toggles allow incomplete and un-tested codepaths to be shipped to production as latent code which may never be turned on.


Release toggles


Implementation Techniques


Toggle Configuration

Source control and re-deployments

Hardcoded Toggle Configuration

Parameterized Toggle Configuration (via command-line arguments or environment variables)

Toggle Configuration File

Tools: Azure App Configuration

img/WYWM_2023_Presentation_Feature_Toggles_Maksim Zinovev18.png|500


Azure App Configuration provides a service to centrally manage application settings and feature flags.

Enables staged rollout of features for targeted audiences

img/WYWM_2023_Presentation_Feature_Toggles_Maksim Zinovev20.png|500

The feature flag is always enabled for user, because is listed in the Users section.

The feature flag is enabled for 50% of other users in the group, because is listed in the Groups section with a Percentage of 50.

The feature is always disabled for all other users, because the Default percentage is set to 0.

img/WYWM_2023_Presentation_Feature_Toggles_Maksim Zinovev23.gif

Best Practices for Using Feature Flags

Testing Feature Toggles

img/WYWM_2023_Presentation_Feature_Toggles_Maksim Zinovev25.png|500

Testing without feature toggles

Exploratory testing

Test E1
Test E2
Test En

Regression testing

Test R1
Test R2
Test Rn

Testing with feature toggles

Number of toggles N=2

Number of combinations C=4

Toggle 1 Toggle 2
Combination 1 ON ON
Combination 2 OFF OFF
Combination 3 ON OFF
Combination 4 OFF ON

Test each combination?

Test E1 – It is safe to skip it 
Test E2 – It is hard do decide. Is it safe to skip it?
Test E3 – We should test this.
Test En

Exploratory testing

Regression testing

Test R1 - It is safe to skip it 
Test R2 - It is hard do decide. Is it safe to skip it?
Test R3 – We should test this. 
Test Rn

Testing with feature toggles

img/WYWM_2023_Presentation_Feature_Toggles_Maksim Zinovev30.jpg|500

img/WYWM_2023_Presentation_Feature_Toggles_Maksim Zinovev33.jpg|500

Integration, E2E testing of large number of flags

img/WYWM_2023_Presentation_Feature_Toggles_Maksim Zinovev35.jpg|500


How do we test this?

Static, Boolean and release toggles

Use the current production configuration plus:

  1. Any toggles you intend to release set to ON
  2. Any toggles you intend to release set to OFF
  3. All toggles set to ON


Testing of large number of flags (option 3)

feature toggles slides-1679811617350.jpeg

Other strategies

  1. Dynamic toggle: test users who move into or out of the targeted group
  2. Experiment toggle: test consistency across user sessions, to ensure individual users are given the correct version at every login.
  3. Permission toggle: explore toggle combinations to see how the new configuration interacts with existing option

Potential Drawbacks of Feature Flags