Software Vulnerability and Functionality Assessment using LLMs

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Jensen, Rasmus Ingemann Tuffveson, Tawosi, Vali, Alamir, Salwa
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866916158472454144
author Jensen, Rasmus Ingemann Tuffveson
Tawosi, Vali
Alamir, Salwa
author_facet Jensen, Rasmus Ingemann Tuffveson
Tawosi, Vali
Alamir, Salwa
contents While code review is central to the software development process, it can be tedious and expensive to carry out. In this paper, we investigate whether and how Large Language Models (LLMs) can aid with code reviews. Our investigation focuses on two tasks that we argue are fundamental to good reviews: (i) flagging code with security vulnerabilities and (ii) performing software functionality validation, i.e., ensuring that code meets its intended functionality. To test performance on both tasks, we use zero-shot and chain-of-thought prompting to obtain final ``approve or reject'' recommendations. As data, we employ seminal code generation datasets (HumanEval and MBPP) along with expert-written code snippets with security vulnerabilities from the Common Weakness Enumeration (CWE). Our experiments consider a mixture of three proprietary models from OpenAI and smaller open-source LLMs. We find that the former outperforms the latter by a large margin. Motivated by promising results, we finally ask our models to provide detailed descriptions of security vulnerabilities. Results show that 36.7% of LLM-generated descriptions can be associated with true CWE vulnerabilities.
format Preprint
id arxiv_https___arxiv_org_abs_2403_08429
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Software Vulnerability and Functionality Assessment using LLMs
Jensen, Rasmus Ingemann Tuffveson
Tawosi, Vali
Alamir, Salwa
Software Engineering
Artificial Intelligence
While code review is central to the software development process, it can be tedious and expensive to carry out. In this paper, we investigate whether and how Large Language Models (LLMs) can aid with code reviews. Our investigation focuses on two tasks that we argue are fundamental to good reviews: (i) flagging code with security vulnerabilities and (ii) performing software functionality validation, i.e., ensuring that code meets its intended functionality. To test performance on both tasks, we use zero-shot and chain-of-thought prompting to obtain final ``approve or reject'' recommendations. As data, we employ seminal code generation datasets (HumanEval and MBPP) along with expert-written code snippets with security vulnerabilities from the Common Weakness Enumeration (CWE). Our experiments consider a mixture of three proprietary models from OpenAI and smaller open-source LLMs. We find that the former outperforms the latter by a large margin. Motivated by promising results, we finally ask our models to provide detailed descriptions of security vulnerabilities. Results show that 36.7% of LLM-generated descriptions can be associated with true CWE vulnerabilities.
title Software Vulnerability and Functionality Assessment using LLMs
topic Software Engineering
Artificial Intelligence
url https://arxiv.org/abs/2403.08429