IP Library › Granted Patent US 12,314,712
Granted Patent B1
US 12,314,712 · App. 17/935,504 · Granted May 27, 2025

Partitioning code bases for parallel execution of code analysis

Inventors: Martin Schaef (Queens, NY); Linghui Luo (Paderborn, DE); Nicolas Leandro Rosner (New York, NY); Aritra Sengupta (Mountain View, CA); Antonio Filieri (Sunnyvale, CA); Thomas L J Cottenier (Sammamish, WA); Lee Pike (Portland, OR)
Assignee: Amazon Technologies, Inc.
G06F8/75G06F8/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,314,712
App. No.
17/935,504
Granted
May 27, 2025
Kind
B1
Abstract

A partitioning technique is applied to divide input code into different portions. Different partitioning techniques can be applied in order to optimize the portioning of the code to account for various features of the code, such as code dependencies. Once partitioned, the code analysis tasks execute in parallel on the code portions. In this way, improved code analysis performance is obtained. Moreover, the addition of new code analysis tasks may not impact overall analysis performance as the partitioning can help to offset added or unknown analysis latency of new code analysis tasks.

Claims (38)

1. A system, comprising:

at least one processor; and

a memory, storing program instructions that when executed by the at least one processor, cause the at least one processor to implement a code analysis system:

receive, via an interface of the code analysis system, a code base for analysis;

select a partitioning technique to apply to the code base based, at least in part, on one or more selections of a plurality of different code analysis tasks to respectively perform on each portion of the code base, wherein the partitioning technique determines how to divide the code base into portions;

apply the selected partitioning technique to the code base to divide the code base into a plurality of code portions;

direct parallel execution of the plurality of different code analysis tasks on the plurality of code portions to determine respective results for the different code analysis tasks based, at least in part, on aggregating portion-specific results for the plurality of code portions for individual ones of the different code analysis tasks; and

send, via the interface, the respective results of the different code analysis tasks.

2. The system of claim 1 , wherein the plurality of different code analysis tasks are selected as part of a request to perform the analysis on the code base received at the code analysis system.

3. The system of claim 1 , wherein the code analysis system is further configured to update performance of the partitioning technique upon a different code base based, at least in part, performance of the parallel execution of the plurality of different code analysis tasks on the plurality of code portions.

4. The system of claim 1 , wherein the code analysis system is implemented as part of a provider network, wherein the code analysis system is configured to receive the request to perform the analysis on the code base from another service of the provider network executing a deployment pipeline.

5. A method, comprising:

performing, by one or more computing devices implementing a code analysis system:

obtaining a code base for analysis;

selecting a partitioning technique to apply to the code base based, at least in part, on one or more selections of a plurality of different code analysis tasks to respectively perform on each portion of the code base, wherein the partitioning technique determines how to divide the code base into portions;

applying the partitioning technique to the code base to divide the code base into a plurality of code portions;

initiating parallel execution of the plurality of different code analysis tasks on the plurality of code portions to determine respective results for the different code analysis tasks based, at least in part, on aggregating portion-specific results for the plurality of code portions for individual ones of the different code analysis tasks; and

providing the respective results of the different code analysis tasks.

6. The method of claim 5 , wherein the plurality of different code analysis tasks are selected as part of a request to perform the analysis on the code base received at the code analysis system.

7. The method of claim 5 , wherein applying the partitioning technique comprises applying a split-merge technique.

8. The method of claim 5 , wherein applying the partitioning technique comprises applying a size limiting technique.

9. The method of claim 5 , further comprising updating performance of the partitioning technique upon a different code base based, at least in part, performance of the parallel execution of the plurality of different code analysis tasks on the plurality of code portions.

10. The method of claim 5 , wherein the plurality of different code analysis tasks are performed within a specified time limit specified as part of a received request to perform the analysis on the code base at the code analysis system.

11. The method of claim 5 , wherein the plurality of code portions comprise two or more overlapping code portions.

12. The method of claim 5 , wherein the partitioning technique is applied based on a partitioning configuration received as part of a request to perform the analysis on the code base at the code analysis system.

13. The method of claim 5 , further comprising receiving a request from a code editor application to perform the analysis on the code base.

14. One or more non-transitory, computer-readable storage media, storing program instructions that when executed on or across one or more computing devices cause the one or more computing devices to implement:

receiving a code base for analysis;

selecting a partitioning technique to apply to the code base based, at least in part, on one or more selections of a plurality of different code analysis tasks to respectively perform on each portion of the code base, wherein the partitioning technique determines how to divide the code base into portions;

applying the partitioning technique to the code base to divide the code base into a plurality of code portions;

causing parallel execution of the plurality of different code analysis tasks on the plurality of code portions to determine respective results for the different code analysis tasks based, at least in part, on aggregating portion-specific results for the plurality of code portions for individual ones of the different code analysis tasks; and

providing the respective results of the different code analysis tasks.

15. The one or more non-transitory, computer-readable storage media of claim 14 , wherein the plurality of different code analysis tasks are selected as part of a received request to perform the analysis on the code base.

16. The one or more non-transitory, computer-readable storage media of claim 14 , wherein the plurality of different code analysis tasks are performed within a specified time limit specified as part of a received request to perform the analysis on the code base.

17. The one or more non-transitory, computer-readable storage media of claim 14 , wherein applying the partitioning technique comprises applying a split-merge technique.

18. The one or more non-transitory, computer-readable storage media of claim 14 , wherein the plurality of code portions comprise two or more overlapping code portions.

19. The one or more non-transitory, computer-readable storage media of claim 14 , wherein the plurality of code portions comprise two or more non-overlapping code portions.

20. The one or more non-transitory, computer-readable storage media of claim 14 , wherein the one or more computing devices are implemented as part of a service of a provider network, wherein the one or more non-transitory, computer-readable storage media store further program instructions that cause the one or more computing devices to further implement receiving the request to perform the analysis on the code base from another service of the provider network executing a deployment pipeline.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 27, 2022
From: SCHAEF, MARTIN; LUO, LINGHUI; ROSNER, NICOLAS LEANDRO; SENGUPTA, ARITRA; FILIERI, ANTONIO; COTTENIER, THOMAS LJ; PIKE, LEE
To: AMAZON TECHNOLOGIES, INC.
Reel/Frame 061229/0831 →
References Cited (75)
US 6226652B1 · Percival · 2001 [cited by examiner]
US 9519464B2 · Dang · 2016 [cited by examiner]
US 10901876B2 · Herrin · 2021 [cited by examiner]
US 10909028B1 · Khanduri · 2021 [cited by examiner]
US 20100306754A1 · Javed · 2010 [cited by examiner]
US 20120291004A1 · Kumar · 2012 [cited by examiner]
US 20130074036A1 · Brandt · 2013 [cited by examiner]
US 20130179867A1 · Fitterer · 2013 [cited by examiner]
US 20160117154A1 · Przygienda · 2016 [cited by examiner]
US 20170177324A1 · Frank · 2017 [cited by examiner]
US 20180373507A1 · Mizrahi · 2018 [cited by examiner]
US 20190079754A1 · Makkar · 2019 [cited by examiner]
US 20200225935A1 · Avgustinov · 2020 [cited by examiner]
US 20200293617A1 · Luo · 2020 [cited by examiner]
US 20200401702A1 · Karabatis · 2020 [cited by examiner]
US 20210132935A1 · Dinh · 2021 [cited by examiner]
US 20210208857A1 · Mahajan · 2021 [cited by examiner]
US 20210406004A1 · Ray · 2021 [cited by examiner]
US 20220137959A1 · Neves · 2022 [cited by examiner]
US 20230281318A1 · Clement · 2023 [cited by examiner]
AU 2018203054B2 · 2019 [cited by examiner]
CN 114443069A · 2022 [cited by examiner]
Hao Yuan and Patrick Th. Eugster. 2009. “An Efficient Algorithm for Solving the Dyck-CFL Reachability Problem on Trees”. In ESOP (LNCS, vol. 5502). Springer, pp. 175-189. [cited by applicant]
Xin Zheng and Radu Rugina. 2008. “Demand-driven alias analysis for C”. In POPL. ACM, pp. 197-208. [cited by applicant]
Zhiqiang Zuo, John Thorpe, Yifei Wang, Qiuhong Pan, Shenming Lu, Kai Wang, Guoqing Harry Xu, Linzhang Wang, and Xuandong Li. 2019. “Grapple: A Graph System for Static Finite-State Property Checking of Large-Scale System… [cited by applicant]
Martin Blais, “Snakefood User Manual,” retrieved from https://furius.ca/snakefood/doc/snakefood-doc.html on Oct. 26, 2022. [cited by applicant]
Aws Albarghouthi, Rahul Kumar, Aditya V. Nori, and Sriram K. Rajamani. “Parallelizing top-down interprocedural analyses”. In PLDI. ACM, 2012, pp. 217-228. [cited by applicant]
Steven Arzt and Eric Bodden. “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 (Hy… [cited by applicant]
Steven Arzt and Eric Bodden. “StubDroid: Automatic Inference of Precise Data-Flow Summaries for the Android Framework”. In 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE). 2016. pap. 725-735. … [cited by applicant]
Vipin Balachandran. 2013. “Reducing Human Effort and Improving Quality in Peer Code Reviews Using Automatic Static Analysis and Reviewer Recommendation”. In Proceedings of the 2013 International Conference on Software E… [cited by applicant]
Jiri Barnat, Lubos Brim, and Jitka Stribrná. 2000. “Distributed LTL Model-Checking in SPIN”. In SPIN (LNCS, vol. 2057). Springer, pp. 209-216. [cited by applicant]
Osbert Bastani, Saswat Anand, and Alex Aiken. 2015. “Specification Inference Using Context-Free Language Reachability”. In POPL. ACM, pp. 553-566. [cited by applicant]
Cristiano Calcagno, Dino Distefano, Jérémy Dubreil, Dominik Gabi, Pieter Hooimeijer, Martino Luca, Peter W. O'Hearn, Irene Papakonstantinou, Jim Purbrick, and Dulma Rodriguez. 2015. “Moving Fast with Software Verificati… [cited by applicant]
Justin Collins. [n.d.]. “Brakeman: Ruby on Rails Static Analysis Security Tool”, from https://brakemanscanner.org/, Aug. 9, 2022, pp. 1-5. [cited by applicant]
Christopher L. Conway, Kedar S. Namjoshi, Dennis Dams, and Stephen A. Edwards. 2005. “Incremental Algorithms for Inter-procedural Analysis of Safety Properties”. In Computer Aided Verification, Kousha Etessami and Srira… [cited by applicant]
Utkarsh Desai, Sambaran Bandyopadhyay, and Srikanth Tamilselvam. 2021. “Graph Neural Network to Dilute Outliers for Refactoring Monolith Application”. In Thirty-Fifth AAAI Conference on Artificial Intelligence, AAAI 202… [cited by applicant]
Lisa Nguyen Quang Do, Karim Ali, Benjamin Livshits, Eric Bodden, Justin Smith, and Emerson Murphy-Hill. 2017. “Just-in-Time Static Analysis”. In Proceedings of the 26th ACM SIGSOFT International Symposium on Software Te… [cited by applicant]
J Michael Emmi, Liana Hadarean, Ranjit Jhala, Lee Pike, Nicolás Rosner, Martin Schäf, Aritra Sengupta, and Willem Visser. 2021. “RAPID: Checking API Usage for the Cloud in the Cloud”. ACM, New York, NY, USA, pp. 1416-14… [cited by applicant]
Cormac Flanagan, K Rustan M Leino, Mark Lillibridge, Greg Nelson, James B Saxe, and Raymie Stata. 2002. “Extended static checking for Java”. In Proceedings of the ACM SIGPLAN 2002 Conference on Programming language desi… [cited by applicant]
Jonas Fritzsch, et al. 2018. “From Monolith to Microservices: A Classification of Refactoring Approaches”. In Software Engineering Aspects of Continuous Development and New Paradigms of Software Production and Deploymen… [cited by applicant]
Diego Garbervetsky, Edgardo Zoppi, and Benjamin Livshits. 2017. “Toward Full Elasticity in Distributed Static Analysis! The Case of Callgraph Analysis” (ESEC/FSE 2017). Association for Computing Machinery, New York, NY,… [cited by applicant]
Emmanuel Geay, Eran Yahav, and Stephen Fink. 2006. “Continuous code-quality assurance with SAFE”. In Proceedings of the 2006 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation. pp. 145-… [cited by applicant]
Orna Grumberg, Tamir Heyman, Nili Ifergan, and Assaf Schuster. 2005. “Achieving Speedups in Distributed Symbolic Reachability Analysis Through Asynchronous Computation”. In IFIP (LNCS, vol. 3725). Springer, pp. 129-145. [cited by applicant]
Nevin Heintze and David A. McAllester. “On the Cubic Bottleneck in Subtyping and Flow Analysis”. LICS '97: Proceedings of the 12th Annual IEEE Symposium on Logic in Computer ScienceJune 1997, pp. 342-351. [cited by applicant]
Susan Horwitz, Thomas W. Reps, and David W. Binkley. 1988. “Interprocedural Slicing Using Dependence Graphs”. In PLDI. ACM, pp. 35-46. [cited by applicant]
Di Jin, Zhizhi Yu, Pengfei Jiao, Shirui Pan, Dongxiao He, Jia Wu, Philip Yu, and Weixiong Zhang. 2021. “A Survey of Community Detection Approaches: From Statistical Modeling to Deep Learning”. IEEE Transactions on Knowl… [cited by applicant]
David S Johnson. 1973. “Near-optimal bin packing algorithms”. Ph.D. Dissertation. Massachusetts Institute of Technology, pp. 1-401. [cited by applicant]
Anup K. Kalia, Jin Xiao, Rahul Krishna, Saurabh Sinha, Maja Vukovic, and Debasish Banerjee. 2021. “Mono2Micro: A Practical and Effective Tool for Decomposing Monolithic Java Applications to Microservices”. Association f… [cited by applicant]
John Kodumal and Alexander Aiken. 2004. “The set constraint/CFL reachability connection in practice”. In PLDI. ACM, pp. 207-218. [cited by applicant]
Rahul Kumar and Eric G. Mercer. 2005. “Load Balancing Parallel Explicit State Model Checking”. Elsevier, ENTCS 128 (2005), pp. 19-34. [cited by applicant]
James A. Kupsch, Barton P. Miller, Vamshi Basupalli, and Josef Burger. 2017. “From continuous integration to continuous assurance”. In 2017 IEEE 28th Annual Software Technology Conference (STC). pp. 1-9. https://doi.org… [cited by applicant]
Yi Lu, Lei Shang, Xinwei Xie, and Jingling Xue. 2013. “An Incremental Points-to Analysis with CFL-Reachability”. In CC (LNCS, vol. 7791). Springer, pp. 61-81. [cited by applicant]
Mario Méndez-Lojo, Augustine Mathew, and Keshav Pingali. 2010. “Parallel inclusion-based points-to analysis”. In OOPSLA. ACM, pp. 428-443. [cited by applicant]
Meta. [n.d.]. “Infer: a static analysis platform for Java, C, and Objective-C”. retrieved from https: //fbinfer.com/docs/about-Infer on Oct. 26, 2022, p. 1. [cited by applicant]
Mangala Gowri Nanda, Monika Gupta, Saurabh Sinha, Satish Chandra, David Schmidt, and Pradeep Balachandran. 2010. “Making Defect-Finding Tools Work for You”. In Proceedings of the 32nd ACM/IEEE International Conference o… [cited by applicant]
Mangala Gowri Nanda and Saurabh Sinha. 2009. “Accurate interprocedural null-dereference analysis for Java”. In 2009 IEEE 31st International Conference on Software Engineering. IEEE, pp. 133-143. [cited by applicant]
NIST. [n.d.]. “Juliet Test Suite for Java”. retrieved from https://samate.nist.gov/SRD/testsuite.php on Oct. 26, 2022, pp. 1-10. [cited by applicant]
OWASP. [n.d.]. “FindSecBugs: the SpotBugs plugin for security audits of Java web applications”. retrieved from https://find-sec-bugs.github.io/ on Oct. 26, 2022, pp. 1-7. [cited by applicant]
OWASP. [n.d.]. “OWASP”. retrieved from https://owasp.org/www-project-benchmark/ on Oct. 26, 2022, pp. 1-4. [cited by applicant]
Praetorian, Inc. [n.d.]. “Gokart: a security-oriented static analysis for Golang with a focus on minimizing false positives”. retrieved from https://github.com/praetorian-inc/gokart/ on Oct. 26, 2022, pp. 1-6. [cited by applicant]
Thomas Reps, Susan Horwitz, and Mooly Sagiv. 1995. “Precise Interprocedural Dataflow Analysis via Graph Reachability”. In Proceedings of the 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (San … [cited by applicant]
Thomas W. Reps. 1997. “Program Analysis via Graph Reachability”. In ISLP. MIT, pp. 5-19. [cited by applicant]
ThomasW. Reps, Susan Horwitz, and Shmuel Sagiv. 1995. “Precise Interprocedural Dataflow Analysis via Graph Reachability”. In POPL. ACM, pp. 49-61. [cited by applicant]
Zachary Rice. [n.d.]. “Gitleaks: a SAST tool for detecting and preventing hardcoded secrets like passwords, api keys, and tokens in git repositories”, retrieved from https://github.com/zricethezav/gitleaks/ on Oct. 26, … [cited by applicant]
Jonathan Rodriguez and Ondrej Lhoták. [n.d.]. “Actor-Based Parallel Dataflow Analysis”. In CC (LNCS, vol. 6601). Springer, 2011, pp. 179-197. [cited by applicant]
Atanas Rountev, Mariana Sharp, and Guoqing Xu. 2008. “IDE Dataflow Analysis in the Presence of Large Object-Oriented Libraries”. In Compiler Construction, Laurie Hendren (Ed.). Springer, pp. 53-68. [cited by applicant]
Caitlin Sadowski, Jeffrey van Gogh, Ciera Jaspan, Emma Söderberg, and Collin Winter. 2015. “Tricorder: Building a Program Analysis Ecosystem”. In Proceedings of the 37th International Conference on Software Engineering—… [cited by applicant]
Amazon Web Services. [n.d.]. “Elastic Compute Cloud (EC2) Pricing”. retrieved fromhttps://aws.amazon.com/ec2/pricing/ on Oct. 26, 2022, pp. 1-7. [cited by applicant]
Gagandeep Singh, Markus Püschel, and Martin T. Vechev. 2017. “Fast polyhedral abstract domain”. In POPL. ACM, pp. 46-59. [cited by applicant]
SonarSource, S.A. [n.d.]. “Sonarqube: a Static Application Security Testing (SAST) solution to detect security issues in code review”. retrieved from https://www.sonarqube.org/features/security/ on Oct. 26, 2022, p. 1-. [cited by applicant]
Yu Su, Ding Ye, and Jingling Xue. 2014. “Parallel Pointer Analysis with CFLReachability”. In ICPP. IEEE Computer Society, pp. 451-460. [cited by applicant]
David Trabish, Andrea Mattavelli, Noam Rinetzky, and Cristian Cadar. 2018. “Chopped symbolic execution”. In ICSE. ACM, pp. 350-360. [cited by applicant]
Jens Van der Plas, Quentin Stiévenart, Noah Van Es, and Coen De Roover. 2020. “Incremental Flow Analysis through Computational Dependency Reification”. In 2020 IEEE 20th International Working Conference on Source Code A… [cited by applicant]
Dimitrios Vardoulakis and Olin Shivers. 2010. “CFA2: A Context-Free Approach to Control-Flow Analysis”. In ESOP (LNCS, vol. 6012). Springer, pp. 570-589. [cited by applicant]
Kai Wang, Aftab Hussain, Zhiqiang Zuo, Guoqing Xu, and Ardalan Amiri Sani. 2017. “Graspan: A Single-Machine Disk-Based Graph System for Interprocedural Static Analyses of Large-Scale Systems Code”. In ASPLOS. ACM, pp. 3… [cited by applicant]