Exploring the Relationship between Test Smells and Code Smells
2025 (English)Independent thesis Advanced level (degree of Master (Two Years)), 20 credits / 30 HE credits
Student thesis
Abstract [en]
Background: In software evolution, code smells and test smells represent design f laws that can negatively impact the maintainability, readability, and reliability of both production and test code. These smells, although not immediately causing defects, can lead to long-term challenges such as increased technical debt, difficulty in debugging, and higher maintenance costs. This research focuses on the survivability of code and test smells, examining how long they persist in the codebase and their impact on software quality. Additionally, it explores the associations between code and test smells, providing insights into how the presence of one may indicate the other, and helping developers prioritise which smells to refactor based on their severity and longevity.
Objectives : The primary objective of this research is to find the survivability of Smells (Code Smells and Test Smells) and to find any possible associations between the smells code smells occurring in production code and test smells occurring in associated test code.
Methods: We conducted archival analysis on five repositories selected from GitHub. To find the survivability of smells we mine the selected repositories using the tool DesigniteJava to detect the smell and find their survivability. We also performed association rule mining to detect any associations with a minimum confidence of 50% between code smells and test smells.
Results:We found that test smells tend to survive longer than code smells. Among code smells, Feature Envy has the lowest survivability, while Magic Number exhibits the highest. For test smells, Ignored Test shows the lowest survivability, whereas Assertion Roulette has the highest. Additionally, we observed that the Long Statement smell in production code is frequently associated with Conditional Test Logic and Exceptional Handling in test code.
Conclusions: The findings highlight that test smells are often less prioritized for resolution compared to code smells, contributing to their higher survivability. The identified associations offer actionable insights for early detection and refactoring prioritization. These results provide a foundation for improving smell detection tools and practices, ultimately enhancing software quality and maintainability.
Place, publisher, year, edition, pages
2025. , p. 49
Keywords [en]
Code Smells, Test smells, Software Repository Mining, Association Rule Mining.
National Category
Software Engineering
Identifiers
URN: urn:nbn:se:bth-27508OAI: oai:DiVA.org:bth-27508DiVA, id: diva2:1941312
Subject / course
PA2534 Master's Thesis (120 credits) in Software Engineering
Educational program
PAADA Master Qualification Plan in Software Engineering 120,0 hp
Supervisors
Examiners
2025-03-032025-02-282025-03-03Bibliographically approved