An Empirical Study of Large Language Models for Type and Call Graph Analysis in Python and JavaScript

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Venkatesh, Ashwin Prasad Shivarpatna, Sunil, Rose, Sabu, Samkutty, Mir, Amir M., Reis, Sofia, Bodden, Eric
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866909690857783296
author Venkatesh, Ashwin Prasad Shivarpatna
Sunil, Rose
Sabu, Samkutty
Mir, Amir M.
Reis, Sofia
Bodden, Eric
author_facet Venkatesh, Ashwin Prasad Shivarpatna
Sunil, Rose
Sabu, Samkutty
Mir, Amir M.
Reis, Sofia
Bodden, Eric
contents Large Language Models (LLMs) are increasingly being explored for their potential in software engineering, particularly in static analysis tasks. In this study, we investigate the potential of current LLMs to enhance call-graph analysis and type inference for Python and JavaScript programs. We empirically evaluated 24 LLMs, including OpenAI's GPT series and open-source models like LLaMA and Mistral, using existing and newly developed benchmarks. Specifically, we enhanced TypeEvalPy, a micro-benchmarking framework for type inference in Python, with auto-generation capabilities, expanding its scope from 860 to 77,268 type annotations for Python. Additionally, we introduced SWARM-CG and SWARM-JS, comprehensive benchmarking suites for evaluating call-graph construction tools across multiple programming languages. Our findings reveal a contrasting performance of LLMs in static analysis tasks. For call-graph generation, traditional static analysis tools such as PyCG for Python and Jelly for JavaScript consistently outperform LLMs. While advanced models like mistral-large-it-2407-123b and gpt-4o show promise, they still struggle with completeness and soundness in call-graph analysis across both languages. In contrast, LLMs demonstrate a clear advantage in type inference for Python, surpassing traditional tools like HeaderGen and hybrid approaches such as HiTyper. These results suggest that, while LLMs hold promise in type inference, their limitations in call-graph analysis highlight the need for further research. Our study provides a foundation for integrating LLMs into static analysis workflows, offering insights into their strengths and current limitations.
format Preprint
id arxiv_https___arxiv_org_abs_2410_00603
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle An Empirical Study of Large Language Models for Type and Call Graph Analysis in Python and JavaScript
Venkatesh, Ashwin Prasad Shivarpatna
Sunil, Rose
Sabu, Samkutty
Mir, Amir M.
Reis, Sofia
Bodden, Eric
Software Engineering
Large Language Models (LLMs) are increasingly being explored for their potential in software engineering, particularly in static analysis tasks. In this study, we investigate the potential of current LLMs to enhance call-graph analysis and type inference for Python and JavaScript programs. We empirically evaluated 24 LLMs, including OpenAI's GPT series and open-source models like LLaMA and Mistral, using existing and newly developed benchmarks. Specifically, we enhanced TypeEvalPy, a micro-benchmarking framework for type inference in Python, with auto-generation capabilities, expanding its scope from 860 to 77,268 type annotations for Python. Additionally, we introduced SWARM-CG and SWARM-JS, comprehensive benchmarking suites for evaluating call-graph construction tools across multiple programming languages. Our findings reveal a contrasting performance of LLMs in static analysis tasks. For call-graph generation, traditional static analysis tools such as PyCG for Python and Jelly for JavaScript consistently outperform LLMs. While advanced models like mistral-large-it-2407-123b and gpt-4o show promise, they still struggle with completeness and soundness in call-graph analysis across both languages. In contrast, LLMs demonstrate a clear advantage in type inference for Python, surpassing traditional tools like HeaderGen and hybrid approaches such as HiTyper. These results suggest that, while LLMs hold promise in type inference, their limitations in call-graph analysis highlight the need for further research. Our study provides a foundation for integrating LLMs into static analysis workflows, offering insights into their strengths and current limitations.
title An Empirical Study of Large Language Models for Type and Call Graph Analysis in Python and JavaScript
topic Software Engineering
url https://arxiv.org/abs/2410.00603