IP Library Granted Patent US 11,334,349
Granted Patent B2
US 11,334,349 · App. 16/575,807 · Granted May 17, 2022

Removing feature flag-related codebase from applications

Inventor: Shubham Gupta (Jaipur, IN)
Assignee: Dell Products L.P.
G06F8/72G06F8/433G06F11/3612
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,334,349
App. No.
16/575,807
Filed
Sep 19, 2019
Granted
May 17, 2022
Kind
B2
Examiner
JEON, JAE UK
Art Unit
2193
USPC
717/127
Abstract

A system and method automatically refactor mature program code having interdependent features to remove instructions pertaining to features that are no longer used. To facilitate reduction of the number of feature dependencies to test, instrumentation data are analyzed to determine which of the available features are in actual use. A graph of feature dependencies is built based on the program configuration, and the program code is simulated, according to existing testing protocols, with various combinations of features disabled to determine whether the program continues to function without error. When features are found that can be safely removed, the codebase is automatically refactored to eliminate the implementing code corresponding to the features. The refactored code then may be further automatically retested and deployed into the production environment.

Claims (33)

1. A method of refactoring program source code of a software service having a plurality of features, the method comprising:

creating a graph of functional dependencies between the plurality of features;

measuring a frequency or count of usage for each of a plurality of code paths executed by the software service in a production environment;

for each code path having a usage exceeding a given threshold, using the graph of functional dependencies to simulate whether errors would occur during execution of the code path if one or more selected features in the plurality of features were disabled; and

for each feature whose disabling would not generate errors during execution of any such code path, automatically refactoring the program source code of the software service to remove the program source code implementing the feature.

2. The method according to claim 1 , wherein creating the graph comprises recursively scanning program source code of the software service for named feature flags to determine the dependencies between the features.

3. The method according to claim 1 , wherein measuring the frequency or count of usage, or both, for each of the plurality of code paths comprises analyzing data logged by the software service during execution in the production environment.

4. The method according to claim 1 , wherein the given threshold for usage comprises either a percentage or a temporal frequency of overall usage of code paths in the software service in the production environment.

5. The method according to claim 1 , wherein the one or more selected features is selected either by automatically traversing the graph of the functional dependencies, or by receiving an input from a user, or both.

6. The method according to claim 1 , further comprising automatically subjecting the refactored program source code to one or more unit tests, integration tests, performance tests, or smoke tests to verify that removal of the program source code implementing the feature will not result in execution errors.

7. The method according to claim 6 , further comprising, when the verification is successful, automatically redeploying the refactored source code into the production environment as the software service.

8. A tangible, computer-readable storage medium, in which is non-transitorily stored computer program code for performing a method of refactoring program source code of a software service having a plurality of features, the method comprising:

creating a graph of functional dependencies between the plurality of features;

measuring a frequency or count of usage for each of a plurality of code paths executed by the software service in a production environment;

for each code path having a usage exceeding a given threshold, using the graph of functional dependencies to simulate whether errors would occur during execution of the code path if one or more selected features in the plurality of features were disabled; and

for each feature whose disabling would not generate errors during execution of any such code path, automatically refactoring the program source code of the software service to remove the program source code implementing the feature.

9. The storage medium according to claim 8 , wherein creating the graph comprises recursively scanning program source code of the software service for named feature flags to determine the dependencies between the features.

10. The storage medium according to claim 8 , wherein measuring the frequency or count of usage, or both, for each of the plurality of code paths comprises analyzing data logged by the software service during execution in the production environment.

11. The storage medium according to claim 8 , wherein the given threshold for usage comprises either a percentage or a temporal frequency of overall usage of code paths in the software service in the production environment.

12. The storage medium according to claim 8 , wherein the one or more selected features is selected either by automatically traversing the graph of the functional dependencies, or by receiving an input from a user, or both.

13. The storage medium according to claim 8 , further comprising automatically subjecting the refactored program source code to one or more unit tests, integration tests, performance tests, or smoke tests to verify that removal of the program source code implementing the feature will not result in execution errors.

14. The storage medium according to claim 13 , further comprising, when the verification is successful, automatically redeploying the refactored source code into the production environment as the software service.

15. A system for refactoring program source code of a software service having a plurality of features and executing in a production environment, the software service logging data to a logging database, the system comprising:

a graph creator for creating a graph of functional dependencies between the plurality of features;

a logging interface for measuring a frequency or count of usage for each of a plurality of code paths executed by the software service in a production environment;

a code path selector for selecting, from the plurality of code paths, those code paths having a usage exceeding a given threshold;

a simulator for simulating, for each of the selected code paths and using the graph of functional dependencies, whether errors would occur during execution of the code path if one or more selected features in the plurality of features were disabled; and

a refactoring unit for automatically refactoring the program source code of the software service to remove the program source code implementing each feature whose removal would not generate errors during execution of any of the selected code paths.

16. The system according to claim 15 , wherein the graph creator is configured for recursively scanning program source code of the software service for named feature flags to determine the dependencies between the features.

17. The system according to claim 15 , wherein the logging interface is further configured for measuring the frequency or count of usage, or both, for each of the plurality of code paths by analyzing data logged in a logging database by the software service during execution in the production environment.

18. The system according to claim 15 , wherein the simulator is configured to obtain the one or more selected features either by automatically traversing the graph of the functional dependencies, or by receiving an input from a user, or both.

19. The system according to claim 15 , further coupled to an integration tester, wherein the refactoring unit automatically causes the integration tester to subject the refactored program source code to one or more unit tests, integration tests, performance tests, or smoke tests to verify that removal of the program source code implementing the feature will not result in execution errors.

20. The system according to claim 15 , further coupled to a deployment gateway, wherein the refactoring unit automatically causes the deployment gateway to redeploy the refactored source code into the production environment as the software service.

Assignments (9)
RELEASE OF SECURITY INTEREST IN PATENTS PREVIOUSLY RECORDED AT REEL/FRAME (053546/0001) Recorded Jun 23, 2022
From: THE BANK OF NEW YORK MELLON TRUST COMPANY, N.A., AS NOTES COLLATERAL AGENT
To: DELL MARKETING L.P. (ON BEHALF OF ITSELF AND AS SUCCESSOR-IN-INTEREST TO CREDANT TECHNOLOGIES, INC.); DELL INTERNATIONAL L.L.C.; DELL PRODUCTS L.P.; DELL USA L.P.; EMC CORPORATION; DELL MARKETING CORPORATION (SUCCESSOR-IN-INTEREST TO FORCE10 NETWORKS, INC. AND WYSE TECHNOLOGY L.L.C.); EMC IP HOLDING COMPANY LLC
Reel/Frame 071642/0001 →
RELEASE OF SECURITY INTEREST IN PATENTS PREVIOUSLY RECORDED AT REEL/FRAME (051302/0528) Recorded Jun 23, 2022
From: THE BANK OF NEW YORK MELLON TRUST COMPANY, N.A., AS NOTES COLLATERAL AGENT
To: DELL PRODUCTS L.P.; EMC IP HOLDING COMPANY LLC; DELL MARKETING CORPORATION (SUCCESSOR-IN-INTEREST TO WYSE TECHNOLOGY L.L.C.); SECUREWORKS CORP.
Reel/Frame 060438/0593 →
RELEASE OF SECURITY INTEREST IN PATENTS PREVIOUSLY RECORDED AT REEL/FRAME (053311/0169) Recorded Jun 23, 2022
From: THE BANK OF NEW YORK MELLON TRUST COMPANY, N.A., AS NOTES COLLATERAL AGENT
To: DELL PRODUCTS L.P.; EMC CORPORATION; EMC IP HOLDING COMPANY LLC
Reel/Frame 060438/0742 →
RELEASE OF SECURITY INTEREST AT REEL 051449 FRAME 0728 Recorded Nov 2, 2021
From: CREDIT SUISSE AG, CAYMAN ISLANDS BRANCH
To: DELL PRODUCTS L.P.; EMC IP HOLDING COMPANY LLC; WYSE TECHNOLOGY L.L.C.; SECUREWORKS CORP.; EMC CORPORATION
Reel/Frame 058002/0010 →
SECURITY INTEREST Recorded Jun 5, 2020
From: DELL PRODUCTS L.P.; EMC CORPORATION; EMC IP HOLDING COMPANY LLC
To: THE BANK OF NEW YORK MELLON TRUST COMPANY, N.A., AS COLLATERAL AGENT
Reel/Frame 053311/0169 →
SECURITY AGREEMENT Recorded Apr 22, 2020
From: CREDANT TECHNOLOGIES INC.; DELL INTERNATIONAL L.L.C.; DELL MARKETING L.P.; DELL PRODUCTS L.P.; DELL USA L.P.; EMC CORPORATION; FORCE10 NETWORKS, INC.; WYSE TECHNOLOGY L.L.C.; EMC IP HOLDING COMPANY LLC
To: THE BANK OF NEW YORK MELLON TRUST COMPANY, N.A.
Reel/Frame 053546/0001 →
SECURITY AGREEMENT Recorded Dec 31, 2019
From: DELL PRODUCTS L.P.; EMC IP HOLDING COMPANY LLC; WYSE TECHNOLOGY L.L.C.; SECUREWORKS CORP.; EMC CORPORATION
To: CREDIT SUISSE AG, CAYMAN ISLANDS BRANCH
Reel/Frame 051449/0728 →
PATENT SECURITY AGREEMENT (NOTES) Recorded Dec 16, 2019
From: DELL PRODUCTS L.P.; EMC IP HOLDING COMPANY LLC; WYSE TECHNOLOGY L.L.C.; SECUREWORKS CORP.
To: THE BANK OF NEW YORK MELLON TRUST COMPANY, N.A., AS COLLATERAL AGENT
Reel/Frame 051302/0528 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 26, 2019
From: GUPTA, SHUBHAM
To: DELL PRODUCTS L.P.
Reel/Frame 050496/0709 →
Continuity (1)
Related Publication 20210089299A1 · Mar 25, 2021
Cited By (2)
US 12,511,108 US 12,693,902