Research on a Neural Machine Translation-Based Approach for Production-Test Code Co-evolution
During the evolution of software, test cases should evolve alongside the production code. Detecting and updating outdated test cases in a timely manner helps lower maintenance costs and prevent potential defects. However, existing methods face limitations in co-evolution pattern mining and automated test code debugging, with rule construction being complex and lacking end-to-end production-test code co-evolution. This study proposes a Neural Machine Translation-based Co-evolution method, NPTCC (Neural Production-Test Code Co-evolution), which analyzes historical commits of production and test code to extract test case features. A neural network classifier and a Transformer updater model are trained separately to identify and update outdated tests, with updated test cases generated through beam search followed by abstraction recovery and syntax checking. Experimental results show that NPTCC significantly improves accuracy in identification and updating tasks compared to traditional methods, with generated test cases performing well in dynamic and manual evaluations. Furthermore, an NPTCC-supported co-evolution system has been developed, enabling developers to automatically identify and update outdated tests, effectively reducing maintenance costs and improving code quality.
Authors
- Xuesong Wang (ORCID: https://orcid.org/0000-0002-7764-2365)
- Ke Wang (ORCID: https://orcid.org/0009-0008-4869-5135)
- Zhang Ren (ORCID: https://orcid.org/0000-0002-6109-4085)
- Lu Li (ORCID: https://orcid.org/0000-0002-2633-7942)
Institutions
- Xidian University (CN)
Publication Details
- Published
- 2024-11-22
- DOI
- https://doi.org/10.1109/icdsca63855.2024.10860129
- Primary Topic
- Industrial Technology and Control Systems
- Type
- article
- Field-Weighted Citation Impact
- 0.00