当前位置: X-MOL 学术J. Syst. Softw. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
A comparative study of test code clones and production code clones
Journal of Systems and Software ( IF 3.7 ) Pub Date : 2021-03-08 , DOI: 10.1016/j.jss.2021.110940
Brent van Bladel , Serge Demeyer

Clones are one of the most widespread code smells, known to negatively affect the evolution of software systems. While there is a large body of research on detecting, managing, and refactoring clones in production code, clones in test code are often neglected in today’s literature. In this paper we provide empirical evidence that further research on clones in test code is warranted. By analysing the clones in five representative open-source systems and comparing production code clones to test code clones, we observe that test code contains twice as many clones as production code. A detailed analysis reveals that most test clones are of Type II and Type III, and that many tests are duplicated multiple times with slight modifications. Moreover, current clone detection tools suffer from false negatives, and that this occurs more frequently in test code than in production code (NiCad = 76%, CPD = 90%, iClones = 12%). So even from a tools perspective, specific fine-tuning for test code is needed.



中文翻译:

测试代码克隆和生产代码克隆的比较研究

克隆是最普遍的代码气味之一,已知会对软件系统的发展产生负面影响。尽管在检测,管理和重构生产代码中的克隆方面进行了大量的研究,但在当今的文献中,测试代码中的克隆经常被忽略。在本文中,我们提供了经验证据,证明有必要对测试代码中的克隆进行进一步的研究。通过分析五个有代表性的开源系统中的克隆并将生产代码克隆与测试代码克隆进行比较,我们观察到测试代码包含的克隆数量是生产代码的两倍。详尽的分析表明,大多数测试克隆属于II型和III型,并且许多测试在稍加修改的情况下重复了多次。而且,当前的克隆检测工具存在假阴性的问题,而且这种情况在测试代码中比在生产代码中发生的频率更高(NiCad = 76%,CPD = 90%,iClones = 12%)。因此,即使从工具的角度来看,也需要对测试代码进行特定的微调。

更新日期:2021-03-17
down
wechat
bug