Table of Contents
Fetching ...

TS-Detector : Detecting Feature Toggle Usage Patterns

Tajmilur Rahman, Mengzhe Fei, Tushar Sharma, Chanchal Roy

TL;DR

The paper tackles the challenge of identifying feature toggle usage smells to maintain code quality. It introduces TS-Detector, a Python-based tool that detects five toggle patterns (dead, nested, spread, mixed, enum) across six languages by combining content extraction with language-specific detectors. Evaluation on ten open-source projects with manual validation shows strong true positive rates for Spread and Nested patterns and solid true negatives for Mixed and Enum, while highlighting sources of false positives from simple global configurations. The work demonstrates the feasibility and impact of automated toggle-pattern detection and outlines directions to improve accuracy, broaden language support, and enhance usability in practice.

Abstract

Feature toggles enable developers to control feature states, allowing the features to be released to a limited group of users while preserving overall software functionality. The absence of comprehensive best practices for feature toggle usage often results in improper implementation, causing code quality issues. Although certain feature toggle usage patterns are prone to toggle smells, there is no tool as of today for software engineers to detect toggle usage patterns from the source code. This paper presents a tool TS-Detector to detect five different toggle usage patterns across ten open-source software projects in six different programming languages. We conducted a manual evaluation and results show that the true positive rates of detecting Spread, Nested, and Dead toggles are 80%, 86.4%, and 66.6% respectively, and the true negative rate of Mixed and Enum usages was 100%. The tool can be downloaded from its GitHub repository and can be used following the instructions provided there.

TS-Detector : Detecting Feature Toggle Usage Patterns

TL;DR

The paper tackles the challenge of identifying feature toggle usage smells to maintain code quality. It introduces TS-Detector, a Python-based tool that detects five toggle patterns (dead, nested, spread, mixed, enum) across six languages by combining content extraction with language-specific detectors. Evaluation on ten open-source projects with manual validation shows strong true positive rates for Spread and Nested patterns and solid true negatives for Mixed and Enum, while highlighting sources of false positives from simple global configurations. The work demonstrates the feasibility and impact of automated toggle-pattern detection and outlines directions to improve accuracy, broaden language support, and enhance usability in practice.

Abstract

Feature toggles enable developers to control feature states, allowing the features to be released to a limited group of users while preserving overall software functionality. The absence of comprehensive best practices for feature toggle usage often results in improper implementation, causing code quality issues. Although certain feature toggle usage patterns are prone to toggle smells, there is no tool as of today for software engineers to detect toggle usage patterns from the source code. This paper presents a tool TS-Detector to detect five different toggle usage patterns across ten open-source software projects in six different programming languages. We conducted a manual evaluation and results show that the true positive rates of detecting Spread, Nested, and Dead toggles are 80%, 86.4%, and 66.6% respectively, and the true negative rate of Mixed and Enum usages was 100%. The tool can be downloaded from its GitHub repository and can be used following the instructions provided there.
Paper Structure (7 sections, 3 figures, 1 table)

This paper contains 7 sections, 3 figures, 1 table.

Figures (3)

  • Figure 1: Development method.
  • Figure 2: TS-Detector Architecture.
  • Figure 3: True-Positives of detecting toggle smells using TS-Detector.