A toggle is a small switch with two positions, on and off, used to activate or disable features in technology devices and software applications. The word toggle can also refer to the act of switching between multiple screen views during a video call with friends, or to the process of turning on and off the lights in a room to control brightness.
While toggles can be a good choice for some settings and content, they shouldn’t be used for things like enabling or disabling core functionality or displaying new or legacy features. They can be confusing to users if they’re unclear about what a toggle does or if it’s in a state that’s inconsistent with other settings on the device. Toggle switches that use color to communicate state can be particularly confusing for people with red/green color blindness.
Savvy teams consider the number of feature toggles in their codebase to be inventory that has a carrying cost, and seek to minimize it. Some teams even have rules that add toggle removal to the team’s backlog whenever a new toggle is introduced, and others put “expiration dates” on their toggles to ensure they’re not hanging around longer than necessary.
When testing with toggles, it’s important to test the configuration that’s expected to go live in production. This means testing the toggles that are flipped On in production and the fall-back configuration where existing or legacy behavior is enabled. In addition, it’s often wise to perform some tests with all toggles flipped Off to ensure that no regressions are hidden by an unexpected change in toggle behavior in a future release.