Security and Quality in LLM-Generated Code: A Multi-Language, Multi-Model Analysis

Mohammed Kharma, Soohyeon Choi, Mohammed AlKhanafseh, David Mohaisen
2/3/2025
cs.CRcs.LGcs.SE

No confident code implementation found for this paper. 5 possible matches can be shown below.

Abstract

Artificial Intelligence (AI)-driven code generation tools are increasingly used throughout the software development lifecycle to accelerate coding tasks. However, the security of AI-generated code using Large Language Models (LLMs) remains underexplored, with studies revealing various risks and weaknesses. This paper analyzes the security of code generated by LLMs across different programming languages. We introduce a dataset of 200 tasks grouped into six categories to evaluate the performance of LLMs in generating secure and maintainable code. Our research shows that while LLMs can automate code creation, their security effectiveness varies by language. Many models fail to utilize modern security features in recent compiler and toolkit updates, such as Java 17. Moreover, outdated methods are still commonly used, particularly in C++. This highlights the need for advancing LLMs to enhance security and quality while incorporating emerging best practices in programming languages.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 5 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{kharma2025security,
  title  = {Security and Quality in LLM-Generated Code: A Multi-Language, Multi-Model Analysis},
  author = {Mohammed Kharma and Soohyeon Choi and Mohammed AlKhanafseh and David Mohaisen},
  year   = {2025},
  eprint = {2502.01853},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.01853v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.01853.svg)](https://codeofpaper.com/paper/2502.01853)

Discussion