实现自动识别生产代码和测试代码的共同变化

Yuan Huang, Zhicao Tang, Xiangping Chen, Xiaocong Zhou
{"title":"实现自动识别生产代码和测试代码的共同变化","authors":"Yuan Huang, Zhicao Tang, Xiangping Chen, Xiaocong Zhou","doi":"10.1002/stvr.1870","DOIUrl":null,"url":null,"abstract":"In software evolution, keeping the test code co-change with the production code is important, because the outdated test code may not work and is ineffective in revealing faults in the production code. However, due to the tight development time, the production and test code may not be co-changed immediately by developers. For example, we analysed the top 1003 popular Java projects on GitHub and found that nearly 9.3% of cases (i.e., 464,417) did not update their production and test code at the same time, that is, the production code is updated first, and then the test code is updated at intervals. The result indicates that much test code will not be updated in time. In this paper, we propose a novel approach, Jtup, to remind developers to co-change the production code and test code in time. Specifically, we first define the co-changed production and test code as a positive instance, while unchanged test code (i.e., production code changed and test code unchanged) as a negative instance. Then, we extract multidimensional features from the production code to characterize the possibility of their co-change, including code change features, code complexity features, and code semantic features. Finally, several machine learning-based methods are employed to identify the co-changed production and test code. We conduct comprehensive experiments on 20 datasets, and the results show that the Accuracy, Precision, and Recall achieved by Jtup are 76.7%, 78.1%, and 77.4%, which outperforms the state-of-the-art method.","PeriodicalId":501413,"journal":{"name":"Software Testing, Verification and Reliability","volume":"60 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-01-11","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Towards automatically identifying the co-change of production and test code\",\"authors\":\"Yuan Huang, Zhicao Tang, Xiangping Chen, Xiaocong Zhou\",\"doi\":\"10.1002/stvr.1870\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"In software evolution, keeping the test code co-change with the production code is important, because the outdated test code may not work and is ineffective in revealing faults in the production code. However, due to the tight development time, the production and test code may not be co-changed immediately by developers. For example, we analysed the top 1003 popular Java projects on GitHub and found that nearly 9.3% of cases (i.e., 464,417) did not update their production and test code at the same time, that is, the production code is updated first, and then the test code is updated at intervals. The result indicates that much test code will not be updated in time. In this paper, we propose a novel approach, Jtup, to remind developers to co-change the production code and test code in time. Specifically, we first define the co-changed production and test code as a positive instance, while unchanged test code (i.e., production code changed and test code unchanged) as a negative instance. Then, we extract multidimensional features from the production code to characterize the possibility of their co-change, including code change features, code complexity features, and code semantic features. Finally, several machine learning-based methods are employed to identify the co-changed production and test code. We conduct comprehensive experiments on 20 datasets, and the results show that the Accuracy, Precision, and Recall achieved by Jtup are 76.7%, 78.1%, and 77.4%, which outperforms the state-of-the-art method.\",\"PeriodicalId\":501413,\"journal\":{\"name\":\"Software Testing, Verification and Reliability\",\"volume\":\"60 1\",\"pages\":\"\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2024-01-11\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Software Testing, Verification and Reliability\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1002/stvr.1870\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Software Testing, Verification and Reliability","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1002/stvr.1870","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

摘要

在软件进化过程中,保持测试代码与生产代码的同步变化非常重要,因为过时的测试代码可能无法工作,也无法有效揭示生产代码中的故障。然而,由于开发时间紧迫,开发人员可能无法立即共同修改生产代码和测试代码。例如,我们分析了 GitHub 上最受欢迎的 1003 个 Java 项目,发现近 9.3% 的案例(即 464 417 个)没有同时更新生产代码和测试代码,即先更新生产代码,然后隔一段时间再更新测试代码。结果表明,很多测试代码不会及时更新。在本文中,我们提出了一种新方法--Jtup,以提醒开发人员及时共同修改生产代码和测试代码。具体来说,我们首先将共同更改的生产代码和测试代码定义为正实例,而将未更改的测试代码(即生产代码更改而测试代码未更改)定义为负实例。然后,我们从生产代码中提取多维特征,包括代码变化特征、代码复杂性特征和代码语义特征,来描述它们共同变化的可能性。最后,我们采用了几种基于机器学习的方法来识别共同变更的生产代码和测试代码。我们在 20 个数据集上进行了全面的实验,结果表明 Jtup 的准确率、精确率和召回率分别为 76.7%、78.1% 和 77.4%,优于最先进的方法。
本文章由计算机程序翻译,如有差异,请以英文原文为准。

Towards automatically identifying the co-change of production and test code

Towards automatically identifying the co-change of production and test code
In software evolution, keeping the test code co-change with the production code is important, because the outdated test code may not work and is ineffective in revealing faults in the production code. However, due to the tight development time, the production and test code may not be co-changed immediately by developers. For example, we analysed the top 1003 popular Java projects on GitHub and found that nearly 9.3% of cases (i.e., 464,417) did not update their production and test code at the same time, that is, the production code is updated first, and then the test code is updated at intervals. The result indicates that much test code will not be updated in time. In this paper, we propose a novel approach, Jtup, to remind developers to co-change the production code and test code in time. Specifically, we first define the co-changed production and test code as a positive instance, while unchanged test code (i.e., production code changed and test code unchanged) as a negative instance. Then, we extract multidimensional features from the production code to characterize the possibility of their co-change, including code change features, code complexity features, and code semantic features. Finally, several machine learning-based methods are employed to identify the co-changed production and test code. We conduct comprehensive experiments on 20 datasets, and the results show that the Accuracy, Precision, and Recall achieved by Jtup are 76.7%, 78.1%, and 77.4%, which outperforms the state-of-the-art method.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信