Can large language model replace static analysis tools

Han Cui
{"title":"Can large language model replace static analysis tools","authors":"Han Cui","doi":"10.1117/12.3031920","DOIUrl":null,"url":null,"abstract":"Static analysis tools are widely used to ensure code quality and security, especially in large software projects. Recently, the advent of Large Language Models (LLM), such as the Generative Pre-trained Transformer (GPT), seems to present a strong ability to handle tasks about static code analysis. This paper aims to answer the question, can large language model replace static analysis tools? We present an extensive evaluation of ChatGPT’s capabilities in identifying and analyzing issues detectable by three well-known Java static analysis tools: PMD, SpotBugs, and SonarQube. Through a series of experiments, we assess the performance of two versions of GPT, GPT-3.5 and GPT-4, across various categories of code issues. We conduct a detailed analysis of the experiment results and discuss the limitation of using ChatGPT to perform as a static analysis tool. The findings during our research suggest that while GPT, especially GPT-4 performs outstanding marks on the dataset we chose, it is improper to fully replace the static code analyzers at the time. Working as the supplementary of static code analyzers can be a nice way to enhance the code quality ensuring projects.","PeriodicalId":198425,"journal":{"name":"Other Conferences","volume":null,"pages":null},"PeriodicalIF":0.0000,"publicationDate":"2024-06-06","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Other Conferences","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1117/12.3031920","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Static analysis tools are widely used to ensure code quality and security, especially in large software projects. Recently, the advent of Large Language Models (LLM), such as the Generative Pre-trained Transformer (GPT), seems to present a strong ability to handle tasks about static code analysis. This paper aims to answer the question, can large language model replace static analysis tools? We present an extensive evaluation of ChatGPT’s capabilities in identifying and analyzing issues detectable by three well-known Java static analysis tools: PMD, SpotBugs, and SonarQube. Through a series of experiments, we assess the performance of two versions of GPT, GPT-3.5 and GPT-4, across various categories of code issues. We conduct a detailed analysis of the experiment results and discuss the limitation of using ChatGPT to perform as a static analysis tool. The findings during our research suggest that while GPT, especially GPT-4 performs outstanding marks on the dataset we chose, it is improper to fully replace the static code analyzers at the time. Working as the supplementary of static code analyzers can be a nice way to enhance the code quality ensuring projects.
大型语言模型能否取代静态分析工具
静态分析工具被广泛用于确保代码质量和安全性,尤其是在大型软件项目中。最近,大型语言模型(LLM)的出现,如生成预训练变换器(GPT),似乎展示了处理静态代码分析任务的强大能力。本文旨在回答这样一个问题:大型语言模型能否取代静态分析工具?我们对 ChatGPT 在识别和分析三种著名 Java 静态分析工具所检测到的问题方面的能力进行了广泛评估:PMD、SpotBugs 和 SonarQube。通过一系列实验,我们评估了两个版本的 GPT(GPT-3.5 和 GPT-4)在各类代码问题上的性能。我们对实验结果进行了详细分析,并讨论了将 ChatGPT 用作静态分析工具的局限性。我们的研究结果表明,虽然 GPT,尤其是 GPT-4 在我们选择的数据集上表现出色,但它目前还不能完全取代静态代码分析器。作为静态代码分析器的辅助工具,GPT 可以很好地提高代码质量,确保项目的顺利进行。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信