SEAIJul 14

SemaDiff: Identifying Semantic-Changing Commits with Generated Code and Tests

arXiv:2607.131113.4h-index: 30Has Code
Predicted impact top 88% in SE · last 90 daysOriginality Incremental advance
AI Analysis

For software repository mining tasks like debugging and fault localization, SemaDiff addresses the gap in distinguishing purely semantic-preserving commits from those with interleaved behavior changes.

SemaDiff identifies semantic-preserving commits by generating tests for modified code and comparing their execution across versions, achieving 76% accuracy and 100% precision in detecting semantic-changing commits on a dataset of 183 Java commits.

Distinguishing semantic-preserving commits from changing ones remains an open challenge in software repository mining. While existing approaches detect refactoring commits accurately, they cannot ensure that a commit is purely semantic-preserving, without any interleaving behaviour-changing modification. This limitation can impact several tasks, such as debugging, fault localisation, bug dataset construction, rollback analysis, and bug fixes backporting. To fill this gap, we propose SemaDiff, a novel approach for identifying semantic-preserving commits through behaviour-based analysis; comparison of similar test execution on pre- and post-commit versions. As code impacted by the refactoring is often hard to test and different accross both versions, we propose generating additional calling methods to that code, which serve as testing target. Given a commit, SemaDiff analyses the diff to identify modified code and extracts unchanged dependent code that calls it. It then generates an additional dependent class using a large language model to exercise the changed code in both versions, and automatically generates tests for the dependent code. This way, we obtain the same tests for the different code versions, enabling the behavioural-difference detection. The commit is classified as semantic-preserving only if all generated tests produce identical outcomes across the two versions. To evaluate SemaDiff, we construct and annotate manually a dataset of 183 commits, gathered from well-known open-source Java projects. The obtained results show that SemaDiff distinguishes accurately semantic-preserving from -- changing commits in about 76% of the cases, with a 100% precision in semantic-changing commit detection.

Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes