ChatGPT Mistakes, Does It Produces Buggy Code?

Is ChatGPT ready to supplant developers?

Mario Rodriguez
Geek Culture

--

Photo by Luca Bravo on Unsplash

ChatGPT, as well as other tools such as Copilot, have been proposed to help humans in programming tasks. You can simply test by typing a programming task, such as “write a python function to compute the least common multiple”. You will receive something like this:

Least commom multiple function in Python writen by ChatGPT

Therefore, this tool may be incredible powerful for learning or increasing developers productivity. However, this paper has analyze the influcen from AI code assistant in developers [1]. This study concluded that developers who used AI assistants were more likely to introduce vulnetabililties or buggy code into their solutions.

For example, the authors of this paper found that developers with AI assistants produced more security vulnerabilities (such as SQL Injtections) than developres without acces to AI assistants. This was also checked in this article.

SQL Injection test

In this article, I asked ChatGPT to write a php function to access a table in a SQL database and retrive a user’s record based on their username. The following Figure shows that ChatGPT…

--

--

Mario Rodriguez
Geek Culture

Communication systems engineer | Python developer | Signal processing | AI | Machine learning | Join me in https://mario-rodriguez.medium.com/membership