학술논문

Piranha: Reducing Feature Flag Debt at Uber
Document Type
Conference
Source
2020 IEEE/ACM 42nd International Conference on Software Engineering: Software Engineering in Practice (ICSE-SEIP) ICSE-SEIP Software Engineering: Software Engineering in Practice (ICSE-SEIP), 2020 IEEE/ACM 42nd International Conference on. :221-230 Oct, 2020
Subject
Computing and Processing
Tools
Testing
Software
Organizations
Mobile applications
Complexity theory
Buildings
code refactoring
feature flags
software maintenance
abstract syntax trees
Language
Abstract
Feature flags are commonly used in mobile app development and can introduce technical debt related to deleting their usage from the codebase. This can adversely affect the overall reliability of the apps and increase their maintenance complexity. Reducing this debt without imposing additional overheads on the developers necessitates the design of novel tools and automated workflows.In this paper, we describe the design and implementation of PIRANHA, an automated code refactoring tool which is used to automatically generate differential revisions (a.k. a diffs) to delete code corresponding to stale feature flags. PIRANHA takes as input the name of the flag, expected treatment behavior, and the name of the flag’s author. It analyzes the ASTs of the program to generate appropriate refactorings which are packaged into a diff. The diffis assigned to the author of the flag for further processing, who can land it after performing any additional refactorings.We have implemented PIRANHA to delete code in Objective-C, Java, and Swift programs, and deployed it to handle stale flags in multiple Uber apps. We present our experiences with the deployment of PIRANHA from Dec 2017 to May 2019, including the following highlights: (a) generated code cleanup diffs for 1381 flags (17% of total flags), (b) 65% of the diffs landed without any changes, (c) over 85% of the generated diffs compile and pass tests successfully, (d) around 80% of the diffs affect more than one file, (e) developers process more than 88% of the generated diffs, (f) 75% of the generated diffs are processed within a week, and (g) PIRANHA diffs have been interacted with by~200 developers across Uber. Piranha is available as open source at https://github.com/uber/ piranha.CCS CONCEPTS• Software and its engineering → Software maintenance tools.