Custodes Mutantur: The short term effect of mutation testing on software maintainability - a case study
2025 (English)Independent thesis Basic level (university diploma), 10 credits / 15 HE credits
Student thesis
Abstract [en]
Mutation testing is a technique for evaluating test effectiveness by introducing small faults into the code and measuring whether the test suite detects them. This thesis explores whether applying mutation testing in a targeted way has a measurable short-term impact on software maintainability and code quality. A case study was conducted in an industrial TypeScript codebase, where randomly selected files were subjected to thorough unit testing aimed at maximizing mutation scores. Maintainability metrics such as Maintainability Index, Halstead Metrics, and Cyclomatic Complexity were tracked before and after the intervention.
The results showed modest improvements in several metrics, including a statistically significant correlation between increases in mutation score and maintainability index when outliers were excluded. However, no defects were uncovered, and many of the changes observed were not found to be statistically significant. While mutation testing did not result in dramatic short-term gains, it surfaced useful refactoring opportunities and reinforced earlier findings that mutation-guided testing can enhance code structure and testability. The study concludes that mutation testing holds value beyond metrics as a catalyst for cleaner, more maintainable code.
Place, publisher, year, edition, pages
2025. , p. 37
Keywords [en]
mutation testing, software maintainability, maintainability index, halstead metrics, case study, unit testing, code maintainability
National Category
Software Engineering
Identifiers
URN: urn:nbn:se:bth-27991OAI: oai:DiVA.org:bth-27991DiVA, id: diva2:1979329
External cooperation
Careium
Subject / course
PA1438 Självständigt arbete Webbprogrammering
Educational program
PAGWG Webbprogrammering
Supervisors
Examiners
2025-07-022025-06-302025-09-30Bibliographically approved