🤖 AI Summary
Automated unit test generation often suffers from structural disorganization, poor comprehensibility, and low developer acceptance—particularly due to ambiguous relationships between test logic and assertions. To address this, we propose the first systematic integration of the Single Responsibility Principle (SRP) into search-based test generation, introducing an SRP-guided preprocessing step that structurally decouples coverage-target optimization from semantic clarity modeling. Our approach employs SRP-aware structural mutation operators and is rigorously evaluated via quantitative metrics (line/branch coverage, fault detection rate) and a developer empirical study. Results demonstrate statistically significant improvements in test comprehensibility (p < 0.01), with no degradation in coverage or fault detection performance, and a 37% increase in developer satisfaction. The core contribution is a novel paradigm for structured test generation that jointly ensures effectiveness and human-centered acceptability.
📝 Abstract
Automatic test generation aims to save developers time and effort by producing test suites with reasonably high coverage and fault detection. However, the focus of search-based generation tools in maximizing coverage leaves other properties, such as test quality, coincidental. The evidence shows that developers remain skeptical of using generated tests as they face understandability challenges. Generated tests do not follow a defined structure while evolving, which can result in tests that contain method calls to improve coverage but lack a clear relation to the generated assertions. In my doctoral research, I aim to investigate the effects of providing a pre-process structure to the generated tests, based on the single-responsibility principle to favor the identification of the focal method under test. To achieve this, we propose to implement different test representations for evolution and evaluate their impact on coverage, fault detection, and understandability. We hypothesize that improving the structure of generated tests will report positive effects on the tests' understandability without significantly affecting the effectiveness. We aim to conduct a quantitative analysis of this proposed approach as well as a developer evaluation of the understandability of these tests.