Repository logo
 

UNDERSTANDING CODE SMELLS AND REFACTORING PRACTICES IN SIMULATION MODELLING SYSTEMS - A COMPREHENSIVE STUDY

Date

2025-08-20

Journal Title

Journal ISSN

Volume Title

Publisher

Abstract

Simulation software systems play a critical role in many areas, including scientific research, planning, and industrial operations. They provide controlled environments for testing and understanding complex real-world scenarios (e.g., Traffic simulation, GHG emission modelling). Despite their importance, they have received limited attention from the software engineering community to date. In particular, their code quality issues, such as code smells and their remediation's, are not well investigated, indicating a major gap in the literature. To address the gap, we conducted two large-scale empirical studies in this thesis. Our first study examines the prevalence, evolution, and impact of code smells in 155 simulation and 327 traditional software systems from GitHub. We find that many implementation-level smells, such as Magic Number and Long Statement, are more prevalent in simulation systems than in traditional systems. We also find that some code smells (e.g., Broken Hierarchy) last longer in simulation systems. Interestingly, we found no correlation between bugs and code smells in simulation systems. Building upon these findings, our second study investigates the effectiveness, risks, and impact of refactoring practices in 104 simulation and 272 traditional software systems from GitHub. Our findings suggest that refactoring removes approximately 35% of Implementation, Design and Architecture smells. However, method-level refactoring activities introduce 2.5 times more code smells than they remove, making them risky. We also found that refactoring activities reduce Structural and Cyclomatic complexity in simulation software systems over time. Thus, our overall findings shed light on the simulation systems code quality issues (e.g., code smells) and refactoring activities, equip software developers and simulation modellers with actionable insights, and also advance the current state of knowledge.

Description

This Master's thesis investigates code quality issues and refactoring practices in simulation software systems. The research addresses a gap in software engineering literature by conducting two large-scale empirical studies comparing simulation systems with traditional software systems. Study 1 analyzes code smells in 155 simulation and 327 traditional software systems from GitHub, finding that implementation-level smells (like Magic Number and Long Statement) are more prevalent in simulation systems, some smells persist longer, but interestingly, no correlation exists between bugs and code smells in simulation systems. Study 2 examines refactoring effectiveness in 104 simulation and 272 traditional systems, discovering that refactoring removes about 35% of Implementation, Design, and Architecture smells. However, method-level refactoring is risky as it introduces 2.5 times more code smells than it removes, while overall refactoring activities do reduce complexity over time.The thesis provides actionable insights for software developers and simulation modelers, advancing understanding of code quality in the unexplored domain of simulation software systems.

Keywords

Software Engineering, Simulation, Code Smell, Refactoring

Citation