The use of LLMs in finding bugs in software applications

No Thumbnail Available

Files

URL

Journal Title

Journal ISSN

Volume Title

Perustieteiden korkeakoulu | Bachelor's thesis
Electronic archive copy is available locally at the Harald Herlin Learning Centre. The staff of Aalto University has access to the electronic bachelor's theses by logging into Aaltodoc with their personal Aalto user ID. Read more about the availability of the bachelor's theses.

Date

2024-05-15

Department

Major/Subject

Tietotekniikka

Mcode

SCI3027

Degree programme

Teknistieteellinen kandidaattiohjelma

Language

en

Pages

22

Series

Abstract

Software developers spend a lot of time finding and fixing bugs. These bugs often arise from a simple oversight or a misunderstanding by the developer. Finding the cause of a bug is a often tedious process called debugging, which is traditionally an act of manual labor carried out by the developer. In recent years, large language models (LLMs) have wildly grown in popularity. Models such as OpenAI's consumer-facing browser-based ChatGPT have millions of users and have brought LLMs to the use of the general public. The objective of this thesis is to examine whether large language models can be used in debugging and in detecting bugs in software applications. This thesis analyzes recent research-papers about the reasons why bugs happen, different ways to debug, how LLMs debug, how well LLMs compare to humans in debugging and what are some possible issues that might arise from the use of LLMs in debugging and bug-detection. Humans have certain techniques in debugging and in this thesis, I review research that compares the success-rates of LLMs to humans of different skill-levels. The research shows that novice developers are quite easily beaten by OpenAI's GPT-3 and GPT-4. However, when presented with a problem that did not have a bug, GPT-4 especially of the two models started trying to fix even the smallest of details. This meant that even though GPT-4 beat GPT-3 in the bugged problems, the false positives brought the overall correctness rate of the model down. When faced off against professional developers, both models lost. The professional developers were able to more accurately find the bugs and report them correctly. However, the professional developers spent approximately 20 minutes per task as the LLMs spent under 10 seconds. This highlights the potential LLMs hold in increasing productivity in software development processes. When reviewing the results of the research comparing LLMs and novice developers in debugging, the main conclusions were that LLMs were far better that the novice developers when presented with a buggy application and that the models had a high false positive rate. The results indicate that LLMs could be applicable in helping novice developers with finding bugs and helping them learn how to debug. Further research could be made in trying to fine-tune the prompts and trying to minimize the high rate of false positives. The results of the research dealing with professional developers and LLMs show that LLMs could be a major help to professional developers too. The LLMs could help in the time-efficiency of the debugging process, leaving the developers with more time to develop new features.

Ohjelmistokehittäjät viettävät paljon aikaa ohjelmistovirheiden (bugien) etsimiseen ja korjaamiseen, mitkä usein johtuvat kehittäjän epähuomiosta tai väärinkäsityksestä. Ohjelmistovirheen syyn löytäminen on usein väsyttävä prosessi, jota kutsutaan virheenkorjaukseksi (engl. debugging). Viime vuosina suurten kielimallien (engl. Large Language Model, LLM) suosio on kasvanut vauhdikkaasti. Malleilla, kuten OpenAI:n kuluttajille suunnatulla selainpohjaisella ChatGPT:llä, on miljoonia käyttäjiä, ja ne ovat tuoneet suuret kielimallit julkiseen käyttöön. Tämän tutkielman tavoitteena on selvittää, voidaanko suuria kielimalleja käyttää virheenkorjauksessa ja ohjelmistosovellusten vikojen havaitsemisessa. Tässä opinnäytetyössä analysoidaan tuoreita tutkimuspapereita siitä, miksi ohjelmistovirheitä tapahtuu, virheenkorjauksen eri tekniikoista, kuinka LLM:t suorittavat virheenkorjausta, kuinka hyviä LLM:t ovat virheenkorjauksessa verrattuna ihmisiin ja mitä ongelmia saattaa syntyä käyttäessä LLM:iä virheenkorjauksessa. Ihmisillä on tiettyjä tekniikoita virheenkorjauksessa ja tässä opinnäytetyössä käyn läpi tutkimuksia missä eri taitotason ohjelmistokehittäjiä verrataan LLM:iin. Tutkimukset osoittavat, että OpenAI:n GPT-3 ja GPT-4 voittavat suhteellisen helposti aloittelevat ohjelmoijat virheenkorjauksessa. Kuitenkin, kun mallille annetaan ongelma, missä ei olekaan ohjelmistovirhettä, GPT-4 varsinkin yrittää silti korjata sitä. Tämä tarkoittaa, että vaikka GPT-4 voittaa GPT-3:n ongelmissa, joissa oli ohjelmointivirhe, väärien positiivisten takia kokonaisvaltainen onnistumisaste laski. Kun malleilla oli ammattilais-ohjelmistokehittäjät vastassa, molemmat mallit hävisivät. Ammattilais-ohjelmistokehittäjät löysivät ohjelmointivirheet paremmin. Ammattilais-ohjelmistokehittäjät käyttivät kuitenkin suunnilleen 20 minuuttia per ongelma, kun taas LLM:t käyttivät alle 10 sekuntia. Tämä alleviivaa LLM:ien potentiaalia ohjelmistokehityksen tuottavuuden lisäämisessä. Kun käydään läpi aloittelevia ohjelmistokehittäjiä ja LLM:iä vertailevan tutkimuksen tuloksia, huomaamme, että LLM:t suoriutuivat paljon paremmin virheellisen koodin korjaamisessa. Huomaamme myös, että malleilla oli korkea väärien positiivisten aste. Tulokset osoittavat, että LLM:iä voisi käyttää aloittelevien ohjelmistokehittäjien avuksi virheentunnistuksessa sekä auttaa heitä oppimaan virheentunnistusta. Lisää tutkimusta voisi tehdä LLM:ien sekä niiden kehotteiden hienosäätämisessä, että korkea aste vääriä positiivisia saataisiin minimoitua. Ammattilaisia ja LLM:iä vertaava tutkimus osoitti, että LLM:t eivät vielä pärjää kokeneille ohjelmistokehittäjille virheentunnistuksessa, mutta LLM:iä voitaisiin jo nyt käyttää apuna myös ammattilaisille. Hyväksikäyttäen LLM:ien nopeutta, ohjelmistokehittäjille jäisi enemmän aikaa uusien toiminnallisuuksien kehittämiseen.

Description

Supervisor

Savioja, Lauri

Thesis advisor

Ahrenberg, Lukas

Keywords

laajat kielimallit, bugit, debuggaus, ohjelmistotuotanto, automaattinen tarkastaminen

Other note

Citation