liu.seSearch for publications in DiVA
Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • oxford
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
Assessing the Readability of AI Generated Code: A Comparisonof Two LLMs
Linköping University, Department of Computer and Information Science, Software and Systems.
2025 (English)Independent thesis Basic level (university diploma), 10,5 credits / 16 HE creditsStudent thesisAlternative title
Läsbarheten hos AI-genererad kod: en jämförelse mellan två LLMs (Swedish)
Abstract [en]

As Large Language Models (LLMs) become increasingly integrated into software engineering workflows, it is important to understand their abilities and limitations when it comes to generating code. This thesis investigates the abilities of two LLMs, GPT-3.5-turbo and WizardCoder-15B-V1.0, to generate readable Python code. HumanEval was used to generate test samples and for functionality testing.

The code generated by both models was analysed using the Radon and Flake8 code analysis tools and compared to human written solutions, on readability attributes established through workshops with four experienced developers. The findings show that LLMs have some ability to generate readable Python code for short HumanEval tasks. Both models generate code that is comparable to human written code in complexity and size while demonstrating higher alignment with best practice for the language. The models falter when it comes to the practice of commenting code, especially without being prompted to document.

This study offers insight into code readability preferences of real world developers and proposes a practical methodology for evaluating readability. Furthermore, the results shed light on the strengths and weaknesses of current LLMs in generating readable code.

Place, publisher, year, edition, pages
2025. , p. 45
Keywords [en]
AI, Artificial intelligence, GPT, WizardCoder, LLM, Large Language Model
National Category
Artificial Intelligence Computer Engineering
Identifiers
URN: urn:nbn:se:liu:diva-218110ISRN: LIU-IDA/LITH-EX-G--25/060--SEOAI: oai:DiVA.org:liu-218110DiVA, id: diva2:2001775
External cooperation
Saab Aeronautics
Subject / course
Computer Engineering
Supervisors
Examiners
Available from: 2025-09-29 Created: 2025-09-28 Last updated: 2025-09-29Bibliographically approved

Open Access in DiVA

fulltext(653 kB)461 downloads
File information
File name FULLTEXT01.pdfFile size 653 kBChecksum SHA-512
911e45a1b9eb503f2fc56df964c1513d37e443c05ed102284629145b02b2d0dda1fed40822b91279eedad00c5b9e2a4047913358132f04b32c02f2e8f4fd9698
Type fulltextMimetype application/pdf

Search in DiVA

By author/editor
Wangkhooklang, Wijitra
By organisation
Software and Systems
Artificial IntelligenceComputer Engineering

Search outside of DiVA

GoogleGoogle Scholar
Total: 464 downloads
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

urn-nbn

Altmetric score

urn-nbn
Total: 846 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • oxford
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf