Temporal Bias in LLM-Generated JavaScript:: A Benchmarking Study of Outdated Pattern Usage
2026 (English)Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE credits
Student thesis
Abstract [en]
The use of Large Language Models (LLM) has becomecommon among software developers. Studies show thatLLM-generated code often contain vulnerabilities, some ofwhich are due to legacy code patterns. A cause for this istemporal bias, which is further divided into cutoff bias anddistribution bias, both of which compel the LLM to generateoutdated code. Previous work to assess the occurrence ofobsolete code patterns has largely been focused on Pythoncode, and there is a gap in the research on the quality ofLLM-generated JavaScript code, which this study aims to fill.An automated tool, the Abstract Syntax Tree basedDeprecation Detector for Large Language Model generatedJavaScript code (AST-DD-LLM-JS) was created and used toquery LLM for JavaScript code snippets, which it scored tocalculate an average modernity score for GPT-5.4, ClaudeSonnet 4.6, GPT-5.4 Nano, and Claude Haiku 4.5. A datasetof 44 deprecated or legacy code patterns was collected toproduce the rules of the tool and to formulate LLM prompts.The results indicate that the tested LLMs generatedeprecated or legacy code on average 10% of the time whenprompted for a code example. When adding a recencyconstraint, the occurrence of outdated patterns fell to 3%.Neither the difference between models nor between codegenerated with or without the recency constraint wasstatistically significant. The study shows that simple codingsolutions generated by current LLMs still contain outdatedcode to a significant degree, and that even careful promptingfails to completely remove it
Place, publisher, year, edition, pages
2026. , p. 16
Keywords [en]
Software Engineering, JavaScript, temporal bias, distribution bias.
National Category
Software Engineering
Identifiers
URN: urn:nbn:se:miun:diva-57817OAI: oai:DiVA.org:miun-57817DiVA, id: diva2:2078740
Subject / course
Computer Engineering DT1
Educational program
Software Engineering TPVBG 180 higher education credits
Supervisors
Examiners
2026-06-242026-06-242026-06-24Bibliographically approved