A feature toggle, (also feature switch, feature flag, feature flipper, conditional feature, etc.) is a technique in software development that attempts to provide an alternative to maintaining multiple source-code branches (known as feature branches).
Continuous release and continuous deployment provide developers with rapid feedback about their coding. This requires the integration their code changes as early as possible. Feature branches introduce a bypass to this process. Feature toggles bring developers back to the track, but the execution paths of their features are still "dead" and "untested" if a toggle is "off". But the effort is low to enable the new execution paths just by setting a toggle to "on".
The technique allows developers to release a version of a product that has unfinished features. These unfinished feature are hidden (toggled) so they do not appear in the user interface. This allows many small incremental versions of software to be delivered without the cost of constant branching and merging.
Fowler states that a feature toggle is the second-best solution. The best solution is to find a way to gradually integrate without feature branches or feature toggles.
- Martin Fowler 29 October 2010 (2010-10-29). "FeatureToggle". Martinfowler.com. Retrieved 2013-09-27.
- "FeatureToggle". Github.com. 2013-02-17. Retrieved 2014-01-16.