COTE: Predicting Code-to-Test Co-Evolution by Integrating Link Analysis and Pre-Trained Language Model Techniques
Tests, as an essential artifact, should co-evolve with the production code to ensure that the associated production code satisfies specification. However, developers often postpone or even forget to update tests, making the tests outdated and lag behind the code. To predict which tests need to be updated when production code is changed, it is challenging to identify all related tests and determine their change probabilities due to complex change scenarios. This paper fills the gap and proposes a hybrid approach named COTE to predict code-to-test co-evolution. We first compute the linked test candidates based on different code-to-test dependencies. After that, we identify common co-change patterns by building a method-level dependence graph. For the remaining ambiguous patterns, we leverage a pre-trained language model which captures the semantic features of code and the change reasons contained in commit messages to judge one test’s likelihood of being updated. Experiments on our datasets consisting of 6,314 samples extracted from 5,000 Java projects show that COTE outperforms state-of-the-art approaches, achieving a precision of 89.0% and a recall of 71.6%. This work can help practitioners reduce test maintenance costs and improve software quality.
Authors
- Chen Lin (ORCID: https://orcid.org/0000-0001-5787-9384)
- Xuansong Li (ORCID: https://orcid.org/0000-0002-9199-9205)
- Yuyong Liu (ORCID: https://orcid.org/0009-0006-9038-5507)
- Wei Song (ORCID: https://orcid.org/0000-0002-4324-3382)
- Yanhui Li (ORCID: https://orcid.org/0000-0003-2282-7175)
- Zhifei Chen (ORCID: https://orcid.org/0000-0002-3475-6979)
Institutions
- Nanjing University of Science and Technology (CN)
- Nanjing University (CN)
Publication Details
- Journal
- IEEE Transactions on Software Engineering
- Published
- 2025-06-27
- DOI
- https://doi.org/10.1109/tse.2025.3583027
- Citations
- 1
- Primary Topic
- Genomics and Phylogenetic Studies
- Type
- article
- Field-Weighted Citation Impact
- 0.81