IP Library Granted Patent US 12,619,405
Granted Patent B2
US 12,619,405 · App. 18/243,710 · Granted May 5, 2026

Method and system for incremental functional approach-based dataflow analysis

Inventors: Anushri Jana (Pune, IN); Bharti Chimdyalwar (Pune, IN); Ramanathan Venkatesh (Pune, IN); Shrawan Kumar (Pune, IN)
Assignee: TATA CONSULTANCY SERVICES LIMITED
G06F8/433G06F8/71
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 12,619,405
App. No.
18/243,710
Granted
May 5, 2026
Kind
B2
Abstract

This disclosure relates generally to method and system for incremental functional approach-based dataflow analysis. Static dataflow analysis can take hours to days depending on size and complexity of the code. In today's agile development environment faster analysis is required which can handle incremental changes to the code in an efficient manner. The method includes by performing a static dataflow analysis over a set of functions of a source code. Further, obtains a set of impacted functions from the source code and executes a dataflow analysis over the set of impacted functions of the source code. The method performs an incremental functional approach-based dataflow analysis over the set of impacted functions including an incremental bottom-up analysis and an incremental top-down analysis. The method efficiently updates results of dataflow analysis in response to incremental changes which is fast and scalable and minimizes the number of procedures by comparing summaries across the versions.

Claims (72)

1 . A processor implemented method of performing incremental functional approach-based dataflow analysis in a source code, the method comprising:

performing via one or more hardware processors a static dataflow analysis over a set of functions of a source code;

identifying via the one or more hardware processors a set of edited functions from the set of functions based on at least one change observed in the source code, wherein each function represents a node comprising a set of statements being called in the source code;

obtaining via the one or more hardware processors a set of impacted functions based on at least one change observed between a current version summary of the source code and a previous version summary of the source code;

executing via the one or more hardware processors a dataflow analysis over the set of impacted functions of the source code which recomputes the set of impacted functions by leveraging one or more cached previous analysis results, instead of re-running an analysis for every changed source code by

performing an incremental bottom-up analysis on one or more selected functions from the set of functions being traversed in a bottom-up order of a call graph originated from each edited function, wherein performing the incremental bottom-up analysis further comprises:

loading a bottom-up worklist of a set of edited functions universally available in a worklist;

listing the set of functions to be traversed in the bottom-up order from the bottom-up worklist;

obtaining a previous version summary of the edited function to compute a current version summary of the edited function; and

performing when the current version summary of the edited function is not identical to the previous version summary of the edited function,

identifying a sequence of a set of caller functions from the set of edited functions and recomputing the current version summary of the set of caller functions, wherein recomputing the current version summary is initially started by identifying a chain of callers of the edited function, recomputing and comparing a respective set of summaries recomputed from the callers of the edited function, and stopping re-computation of the current version summary when a procedure with the current version summary matching the previous version summary is found;

updating a summary of each edited function with the current version summary; and

identifying a set of called functions from the set of edited functions and adding a set of called functions universally available to the set of impacted functions;

performing an incremental top-down analysis over the set of impacted functions by traversing the call graph in a top-down order; and

performing via the one or more hardware processors, an incremental functional approach-based dataflow analysis over the set of impacted functions based on the current version summary of the source code, the incremental bottom-up analysis, and the incremental top-down analysis, wherein the incremental functional approach-based dataflow analysis forms a summary of each procedure using a bottom-up traversal over the call graph, analyzes every procedure only once even if the procedure includes multiple calls and resulting summaries computed using the bottom-up traversal replace calls in a set of caller functions to construct a summary of the set of caller functions and the call graph is traversed in bottom-up order,

implementing via the one or more hardware processors, the incremental functional approach-based dataflow analysis as an incremental static analysis tool that upon execution provides analysis and additionally stores program analysis information.

2 . The processor implemented method as claimed in claim 1 , wherein the incremental bottom-up analysis computes a set of edited function summaries and a set of function summaries marked as the set of impacted functions, wherein the summaries are computed based on at least one change observed when the current version summary and the previous version summary are compared.

3 . The processor implemented method as claimed in claim 1 , wherein the incremental top-down analysis updates one or more dataflow values of the set of impacted functions by traversing the call graph in the top-down order.

4 . The processor implemented method as claimed in claim 1 , wherein performing the incremental top-down analysis comprises:

loading a top-down worklist with a set of procedures and listing the set of impacted functions to be traversed in the top-down order from the worklist;

obtaining the set of impacted functions universally available in the set of functions and in the set of impacted functions;

fetching the set of called functions from the set of impacted functions; and

computing an entry of each called function based on a summary of the set of impacted functions and updating the entry of each called function.

5 . A system for performing incremental functional approach-based dataflow analysis in a source code comprising:

a memory storing instructions;

one or more communication interfaces; and

one or more hardware processors coupled to the memory via the one or more communication interfaces, wherein the one or more hardware processors are configured by the instructions to:

perform a static dataflow analysis over a set of functions of a source code;

identify a set of edited functions from the set of functions based on at least one change observed in the source code, wherein each function represents a node comprising a set of statements being called in the source code;

obtain a set of impacted functions based on at least one change observed between a current version summary of the source code and a previous version summary of the source code;

execute a dataflow analysis over the set of impacted functions of the source code which recomputes the set of impacted functions by leveraging one or more cached previous analysis results, instead of re-running an analysis for every changed source code by

performing an incremental bottom-up analysis on one or more selected functions from the set of functions being traversed in a bottom-up order of a call graph originated from each edited function, wherein performing the incremental bottom-up analysis further comprises:

loading a bottom-up worklist of a set of edited functions universally available in a worklist;

listing the set of functions to be traversed in the bottom-up order from the bottom-up worklist;

obtaining a previous version summary of the edited function to compute a current version summary of the edited function; and

performing when the current version summary of the edited function is not identical to the previous version summary of the edited function,

identifying a sequence of a set of caller functions from the set of edited functions and recomputing the current version summary of the set of caller functions, wherein recomputing the current version summary is initially started by identifying a chain of callers of the edited function, recomputing and comparing a respective set of summaries recomputed from the callers of the edited function, and stopping re-computation of the current version summary when a procedure with the current version summary matching the previous version summary is found;

updating a summary of each edited function with the current version summary; and

identifying a set of called functions from the set of edited functions and adding a set of called functions universally available to the set of impacted functions;

performing an incremental top-down analysis over the set of impacted functions by traversing the call graph in a top-down order and

perform an incremental functional approach-based dataflow analysis over the set of impacted functions based on the current version summary of the source code, the incremental bottom-up analysis, and the incremental top-down analysis, wherein the incremental functional approach-based dataflow analysis forms a summary of each procedure using a bottom-up traversal over the call graph, analyzes every procedure only once even if the procedure includes multiple calls and resulting summaries computed using the bottom-up traversal replace calls in a set of caller functions to construct a summary of the set of caller functions and the call graph is traversed in bottom-up order,

implementing the incremental functional approach-based dataflow analysis as an incremental static analysis tool that upon execution provides analysis and additionally stores program analysis information.

6 . The system as claimed in claim 5 , wherein the incremental bottom-up analysis computes a set of edited functions summaries and a set of function summaries marked as the set of impacted functions, wherein the summaries are computed based on at least one change observed when the current version summary and the previous version summary are compared.

7 . The system as claimed in claim 5 , wherein the incremental top-down analysis updates one or more dataflow values of the set of impacted functions by traversing the call graph in the top-down order.

8 . The system as claimed in claim 5 , wherein performing the incremental top-down analysis comprises:

loading a top-down worklist with a set of procedures and listing the set of impacted functions to be traversed in the top-down order from the worklist;

obtaining the set of impacted functions universally available in the set of functions and in the set of impacted functions;

fetching the set of called functions from the set of impacted functions; and

computing an entry of each called function based on a summary of the set of impacted functions and updating the entry of each called function.

9 . One or more non-transitory machine-readable information storage mediums comprising one or more instructions which when executed by one or more hardware processors cause:

performing a static dataflow analysis over a set of functions of a source code;

identifying via the one or more hardware processors, a set of edited functions from the set of functions based on at least one change observed in the source code, wherein each function represents a node comprising a set of statements being called in the source code;

obtaining a set of impacted functions based on at least one change observed between a current version summary of the source code and a previous version summary of the source code;

executing a dataflow analysis over the set of impacted functions of the source code which recomputes the set of impacted functions by leveraging one or more cached previous analysis results, instead of re-running an analysis for every changed source code by

performing an incremental bottom-up analysis on one or more selected functions from the set of functions being traversed in a bottom-up order of a call graph originated from each edited function, wherein performing the incremental bottom-up analysis further comprises:

loading a bottom-up worklist of a set of edited functions universally available in a worklist;

listing the set of functions to be traversed in the bottom-up order from the bottom-up worklist;

obtaining a previous version summary of the edited function to compute a current version summary of the edited function; and

performing when the current version summary of the edited function is not identical to the previous version summary of the edited function,

identifying a sequence of a set of caller functions from the set of edited functions and recomputing the current version summary of the set of caller functions, wherein recomputing the current version summary is initially started by identifying a chain of callers of the edited function, recomputing and comparing a respective set of summaries recomputed from the callers of the edited function, and stopping re-computation of the current version summary when a procedure with the current version summary matching the previous version summary is found;

updating a summary of each edited function with the current version summary; and

identifying a set of called functions from the set of edited functions and adding a set of called functions universally available to the set of impacted functions;

performing an incremental top-down analysis over the set of impacted functions by traversing the call graph in a top-down order; and

performing an incremental functional approach-based dataflow analysis over the set of impacted functions based on the current version summary of the source code, the incremental bottom-up analysis, and the incremental top-down analysis, wherein the incremental functional approach-based dataflow analysis forms a summary of each procedure using a bottom-up traversal over the call graph, analyzes every procedure only once even if the procedure includes multiple calls and resulting summaries computed using the bottom-up traversal replace calls in a set of caller functions to construct a summary of the set of caller functions and the call graph is traversed in bottom-up order,

implementing the incremental functional approach-based dataflow analysis as an incremental static analysis tool that upon execution provides exhaustive analysis and additionally stores store program analysis information.

10 . The one or more non-transitory machine-readable information storage mediums of claim 9 , wherein the incremental bottom-up analysis computes a set of edited function summaries and a set of function summaries marked as the set of impacted functions, wherein the summaries are computed based on at least one change observed when the current version summary and the previous version summary are compared.

11 . The one or more non-transitory machine-readable information storage mediums of claim 9 , wherein the incremental top-down analysis updates one or more dataflow values of the set of impacted functions by traversing the call graph in the top-down order.

12 . The one or more non-transitory machine-readable information storage mediums of claim 9 , wherein performing the incremental top-down analysis comprises:

loading a top-down worklist with a set of procedures and listing the set of impacted functions to be traversed in the top-down order from the worklist;

obtaining the set of impacted functions universally available in the set of functions and in the set of impacted functions;

fetching the set of called functions from the set of impacted functions; and

computing an entry of each called function based on a summary of the set of impacted functions and updating the entry of each called function.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 8, 2023
From: JANA, ANUSHRI; CHIMDYALWAR, BHARTI; VENKATESH, RAMANATHAN; KUMAR, SHRAWAN
To: TATA CONSULTANCY SERVICES LIMITED
Reel/Frame 064838/0697 →
Priority Claims (1)
IN 202221061597 · Oct 28, 2022 · national
Continuity (1)
Related Publication 20240143299A1 · May 2, 2024
References Cited (15)
US 7962434B2 · Estan et al. · 2011 [cited by applicant]
US 9817643B2 · He et al. · 2017 [cited by applicant]
US 10127135B2 · Li et al. · 2018 [cited by applicant]
US 11175897B1 · Deng · 2021 [cited by examiner]
US 20130031531A1 · Keynes · 2013 [cited by examiner]
US 20160098342A1 · Faizanullah · 2016 [cited by examiner]
US 20170017472A1 · He · 2017 [cited by examiner]
CN 109426722A · 2019 [cited by applicant]
JP 6234935B2 · 2017 [cited by applicant]
Arzt, S., & Bodden, E. (May 2014). Reviser: efficiently updating IDE-/IFDS-based data-flow analyses in response to incremental program changes. In Proceedings of the 36th International Conference on Software Engineering… [cited by examiner]
Pollock et al., “An Incremental Version of Iterative Data Flow Analysis,” IEEE Transactions on Software Engineering, 15(12) (1989). [cited by applicant]
Reps et al., “Interprocedural Dataflow Analysis via Graph Reachability.” [cited by applicant]
Rountev et al., “Interprocedural Dataflow Analysis in the Presence of Large Libraries,” (2006). [cited by applicant]
Schubert et al., “Lossless, Persisted Summarization of Static Callgraph, Points-To and Data-Flow Analysis,” (2012). [cited by applicant]
Shi et al., “Pipelining Bottom-up Data Flow Analysis,” (2020). [cited by applicant]