Project Team


Students

Benjamin Park
Computer Science
Penn State, Behrend






Faculty Mentors

Shahid Hussain
Penn State, Behrend
School of Engineering










Project








Project Video




video player icon




Project Abstract


Code smells are problematic patterns in code that make programs harder to maintain, read, and repair over time. Traditional tools using simple rules or basic machine learning often miss the mark: they are not accurate enough, struggle to express multiple code smells at the same time, and fail to assess severity levels. While large language models (LLMs) have revolutionized software engineering tasks like generating, fixing, and explaining code, their application to code smell detection in a specific field, like the game development area, is underexplored. A study has been conducted on PEFT and LoRA settings to detect code smells, but not in this specific field. Therefore, we systematically assess the utility of leading PEFT methods, focusing on LoRA, for fine-tuning the DeepSeek-Coder 1.3B Instruct model into two specialized variants tailored for C++ code analysis. We first curated high-quality datasets in JSON format from Clang-Tidy static analyses and Tree-Sitter parses of open-source C++ game engine GitHub repositories, comprising instruct-style prompt-completion pairs for detection (identifying smell types, locations, and counts) and remediation (generating fixed code with explanations). These were embedded with system prompts to enforce structured outputs. We then fine-tuned the model using LoRA within PEFT, incorporating 4-bit quantization and adaptive batching, and GPU for inference. For the result, the detection model identified smells, and the remediation model produced maintainable fixes. We developed an efficient, dual-model pipeline that able to handle more tokens, optimized for low-resource setups with GPU acceleration. This work advances LLM integration in software engineering by demonstrating PEFT’s efficacy for code quality automation, filling gaps in resource-efficient adaptations. It suggests broader adoption could reduce manual debugging, enhance software sustainability, and boost developer productivity in the game development field. Future research might extend to other programming languages or industries.




Evaluate this Project


Use this form link to provide feedback to the presenters, and add your project evaluation for award(s) consideration.