Has it ever happened to you that you're using an app and see a new feature… but someone else doesn't have it?
It's not a bug or a secret version: it's feature flags in action.
Feature flags are a tool that lets you turn features on or off without needing a new deployment. In other words, the code is already in production, but the feature can be «hidden» or available only to certain users.
What feature flags are and how they work
Imagine you have a switch that decides who sees a new feature. Before showing something, the system checks whether that «flag» is on for you. If it's ON, you see the new feature. If it's OFF, you don't even know it exists.
This allows gradual rollouts, A/B tests or validating new ideas without affecting all users. For example, a feature can be enabled only for internal testers, for a specific country or for a small percentage of traffic.
Benefits of feature flags for testing and development
From a testing point of view, they have many benefits:
- Safer testing in production: you can validate with real users, but in a controlled way.
- Easier A/B testing: they let you compare versions and measure results based on real data.
- More frequent and less risky deployments: you can release «incomplete» code and turn it on later, reducing the size of each change.
In short, they help speed up development and reduce release risk.
Challenges and risks for testing
But it's not that simple. This tool also brings its own complexities:
- Combinatorial explosion: each new flag multiplies the possible combinations. With 5 flags, there are 32 different scenarios. And that makes it impossible to test them all.
- More complex automated tests: you have to decide which combinations to test: all ON, all OFF and some critical cases.
- Technical debt: when flags aren't removed after the rollout, they remain as legacy code and pollute the tests.
- Difficulty reproducing bugs: if you don't know which flags a user had enabled, it can be very hard to understand why something failed.
Best practices
To keep them from turning into chaos, there are some best practices:
- Limit the number of flags active at the same time.
- Remove the ones that have already served their purpose.
- Document the critical combinations that must be tested.
- Use short-lived flags: weeks or months, not years.
- Include integration tests that validate the main paths with different configurations.
In short
Feature flags are a powerful tool if you use them strategically. They let you test in production, release faster and validate with real data… but if you let them grow out of control, they can complicate your testing and fill your environment with technical debt.
In the next video I'll tell you how I organize testing when there are multiple active flags, so you don't lose visibility or time.
Frequently asked questions
What are feature flags?
A tool that lets you turn features on or off without a new deployment: the code is already in production, but the feature can be hidden or available only to certain users.
What challenges do feature flags bring to testing?
Combinatorial explosion (with 5 flags there are 32 different scenarios), more complex automated tests, technical debt when flags aren't removed and difficulty reproducing bugs.
Keep reading: What is technical debt? and How to reduce the number of cases to execute by 96%?. If you want to go deeper, I recommend the course Testing in agile contexts.