消除测试气味能在多大程度上提高代码质量?

Haitao Wu, Ruidi Yin, Jianhua Gao, Zijie Huang, Huajun Huang
{"title":"消除测试气味能在多大程度上提高代码质量?","authors":"Haitao Wu, Ruidi Yin, Jianhua Gao, Zijie Huang, Huajun Huang","doi":"10.1109/ICCQ53703.2022.9763153","DOIUrl":null,"url":null,"abstract":"Software testing is a key activity to guarantee software reliability and maintainability. However, developers tend to ignore the maintenance of test code when performing a tradeoff between code quality and release deadlines. Moreover, the lack of research to quantify the relationship between test code and production code quality. As a result, test quality degrades due to the lack of appropriate refactoring plans. This paper fills the gap by evaluating to what extent can code quality be improved by eliminating test smells. First, we detect the presence of test smells in 119 historical releases of 10 open-source projects. Afterward, we evaluate code quality in 2 aspects, i.e., defect- and change-proneness. Finally, we exploit the odds ratio and Mann-Whitney test to quantify the extent of variation for the code quality. Results show that the OR values of the test code and production code are both much greater than 1, which proves that the test smell is indeed a risk factor to increase the defect-proneness of code. Moreover, the change-proneness of the test code and associated production code reduces significantly after their elimination. Experiment also reveals Assertion Roulette is the riskiest smell to degrade production code quality.","PeriodicalId":174100,"journal":{"name":"2022 International Conference on Code Quality (ICCQ)","volume":"54 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2022-04-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"2","resultStr":"{\"title\":\"To What Extent Can Code Quality be Improved by Eliminating Test Smells?\",\"authors\":\"Haitao Wu, Ruidi Yin, Jianhua Gao, Zijie Huang, Huajun Huang\",\"doi\":\"10.1109/ICCQ53703.2022.9763153\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Software testing is a key activity to guarantee software reliability and maintainability. However, developers tend to ignore the maintenance of test code when performing a tradeoff between code quality and release deadlines. Moreover, the lack of research to quantify the relationship between test code and production code quality. As a result, test quality degrades due to the lack of appropriate refactoring plans. This paper fills the gap by evaluating to what extent can code quality be improved by eliminating test smells. First, we detect the presence of test smells in 119 historical releases of 10 open-source projects. Afterward, we evaluate code quality in 2 aspects, i.e., defect- and change-proneness. Finally, we exploit the odds ratio and Mann-Whitney test to quantify the extent of variation for the code quality. Results show that the OR values of the test code and production code are both much greater than 1, which proves that the test smell is indeed a risk factor to increase the defect-proneness of code. Moreover, the change-proneness of the test code and associated production code reduces significantly after their elimination. Experiment also reveals Assertion Roulette is the riskiest smell to degrade production code quality.\",\"PeriodicalId\":174100,\"journal\":{\"name\":\"2022 International Conference on Code Quality (ICCQ)\",\"volume\":\"54 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2022-04-23\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"2\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"2022 International Conference on Code Quality (ICCQ)\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1109/ICCQ53703.2022.9763153\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"2022 International Conference on Code Quality (ICCQ)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/ICCQ53703.2022.9763153","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 2

摘要

软件测试是保证软件可靠性和可维护性的关键活动。然而,当在代码质量和发布期限之间进行权衡时,开发人员倾向于忽略测试代码的维护。此外,缺乏量化测试代码和生产代码质量之间关系的研究。结果,由于缺乏适当的重构计划,测试质量下降。本文通过评估通过消除测试气味可以在多大程度上提高代码质量来填补这一空白。首先,我们在10个开源项目的119个历史版本中检测到测试气味的存在。然后,我们从两个方面评估代码质量,即缺陷和变更倾向。最后,我们利用比值比和曼-惠特尼测试来量化代码质量的变化程度。结果表明,测试代码和生产代码的OR值都远大于1,证明测试气味确实是增加代码缺陷倾向的风险因素。此外,测试代码和相关产品代码的变更倾向在它们被消除后显著降低。实验还揭示了断言轮盘是降低生产代码质量的最危险的气味。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
To What Extent Can Code Quality be Improved by Eliminating Test Smells?
Software testing is a key activity to guarantee software reliability and maintainability. However, developers tend to ignore the maintenance of test code when performing a tradeoff between code quality and release deadlines. Moreover, the lack of research to quantify the relationship between test code and production code quality. As a result, test quality degrades due to the lack of appropriate refactoring plans. This paper fills the gap by evaluating to what extent can code quality be improved by eliminating test smells. First, we detect the presence of test smells in 119 historical releases of 10 open-source projects. Afterward, we evaluate code quality in 2 aspects, i.e., defect- and change-proneness. Finally, we exploit the odds ratio and Mann-Whitney test to quantify the extent of variation for the code quality. Results show that the OR values of the test code and production code are both much greater than 1, which proves that the test smell is indeed a risk factor to increase the defect-proneness of code. Moreover, the change-proneness of the test code and associated production code reduces significantly after their elimination. Experiment also reveals Assertion Roulette is the riskiest smell to degrade production code quality.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
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学术官方微信