Digitala Vetenskapliga Arkivet

Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • 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
AI som kodarkitekt: En kvantitativ utvärdering av AI-genererad kodkomplexitet i objektorienterad kod
Uppsala University, Disciplinary Domain of Humanities and Social Sciences, Faculty of Social Sciences, Department of Informatics and Media.
Uppsala University, Disciplinary Domain of Humanities and Social Sciences, Faculty of Social Sciences, Department of Informatics and Media.
2026 (Swedish)Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE creditsStudent thesis
Abstract [sv]

I takt med att generativ Artificiell Intelligensen (AI) har börjat användas inom mjukvaruutveckling väcks även frågor kring den genererade kodens kvalitet. Samtidigt som tekniken möjliggör en snabbare produktionstakt, kan komplex och rörig kod på sikt bygga upp en teknisk skuld. Medan tidigare forskning främst undersöker kodens procedurella kodkomplexitet, lämnas objektorienterad arkitektonisk komplexitet outforskat. Denna studie ämnar att fylla denna kunskapslucka genom att applicera C&K-metriken på AI-genererade kodprojekt skrivna i C#. Studien genomför ett formellt experiment, där AI-modellerna Claude Opus 4.6, Gemini 3.1 Pro och GPT-5.4 instrueras att utveckla en mindre e-handelswebbsida för att sedan jämföra detta med ett mänskligt skrivet best-practice-projekt. Studiens resultat visar att samtliga modeller genererar kod vars C&K-värden i genomsnitt är jämförbart med ett best-practice-projekt där modellerna överlag skapade välstrukturerad kod. GPT-5.4 och Gemini 3.1 Pro presterade för det mesta nära referensprojektet och genererade allmänt stabila resultat, medan Claude Opus 4.6 presterade mer oförutsägbart och skapade en mindre väluppdelad kodarkitektur. 

Abstract [en]

Generative Artificial Intelligence (AI) has become an increasingly common tool within software development, which has led to questions about the quality of the generated code. While such technology enables faster development, complex and poorly structured code may, over time, accumulate technical debt. While previous research predominantly studies procedural code complexity, object-oriented architectural complexity remains largely unexplored. This study aims to bridge this gap by applying the C&K-metric suite to AI-generated code projects written in C#. The study conducts a formal experiment in which the AI models Claude Opus 4.6, Gemini 3.1 Pro, and GPT-5.4 are tasked with developing a small e-commerce website, which will be compared against a human-written, best-practice project. The results demonstrate that the respective models, on average, generate code with C&K values comparable to the best-practice project; overall producing well-structured code. GPT-5.4 and Gemini 3.1 Pro consistently performed close to the reference project and yielded generally stable results, whereas Claude Opus 4.6 exhibited greater unpredictability and generated a less modular code architecture.

Place, publisher, year, edition, pages
2026. , p. 77
Keywords [en]
Generative Artificial Intelligence, object-oriented programming, architectural complexity, maintainability, C&K metrics, technical debt
Keywords [sv]
Generativ Artificiell Intelligens, objektorienterad programmering, arkitektonisk komplexitet, underhållbarhet, C&K-metrik, teknisk skuld
National Category
Information Systems, Social aspects
Identifiers
URN: urn:nbn:se:uu:diva-593117OAI: oai:DiVA.org:uu-593117DiVA, id: diva2:2081573
Supervisors
Available from: 2026-06-30 Created: 2026-06-29 Last updated: 2026-06-30Bibliographically approved

Open Access in DiVA

fulltext(1874 kB)52 downloads
File information
File name FULLTEXT01.pdfFile size 1874 kBChecksum SHA-512
f28297c4ab5557d307401283d7e1bed235a58405d2ad2bf21bc1fc9870b7fbb9bfda48f9b0cc3505de77192875991344e9702683be5305f1085a48833d4e276f
Type fulltextMimetype application/pdf

By organisation
Department of Informatics and Media
Information Systems, Social aspects

Search outside of DiVA

GoogleGoogle Scholar
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: 767 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • 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