{"title":"A Novel Approach for Detecting Type-IV Clones in Test Code","authors":"B. V. Bladel, S. Demeyer","doi":"10.1109/IWSC.2019.8665855","DOIUrl":null,"url":null,"abstract":"The typical structure of unit test code (setup - stimulate - verify - teardown) gives rise to duplicated test logic. Researchers have demonstrated the widespread use of syntactic clones in test code, yet if duplicated test code is indeed a problem, then semantic clones may be an issue as well. However, while detecting syntactic similarities can be done relatively easy, semantic similarities are more difficult to find. In this paper we present a novel way of detecting semantic clones by exploiting the unique features present in test code. We demonstrate on the Apache Commons Math Library’s test suite that our approach can detect 259 semantic clones, of which only 54 were also detected by NiCad. This confirms that it is both feasible and worthwhile to investigate semantic clones in test code.","PeriodicalId":341328,"journal":{"name":"2019 IEEE 13th International Workshop on Software Clones (IWSC)","volume":"7 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2019-02-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"7","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2019 IEEE 13th International Workshop on Software Clones (IWSC)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/IWSC.2019.8665855","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 7
Abstract
The typical structure of unit test code (setup - stimulate - verify - teardown) gives rise to duplicated test logic. Researchers have demonstrated the widespread use of syntactic clones in test code, yet if duplicated test code is indeed a problem, then semantic clones may be an issue as well. However, while detecting syntactic similarities can be done relatively easy, semantic similarities are more difficult to find. In this paper we present a novel way of detecting semantic clones by exploiting the unique features present in test code. We demonstrate on the Apache Commons Math Library’s test suite that our approach can detect 259 semantic clones, of which only 54 were also detected by NiCad. This confirms that it is both feasible and worthwhile to investigate semantic clones in test code.
单元测试代码的典型结构(设置-刺激-验证-拆除)导致了重复的测试逻辑。研究人员已经证明了在测试代码中广泛使用语法克隆,但是如果重复的测试代码确实是一个问题,那么语义克隆也可能是一个问题。然而,虽然检测语法相似度相对容易,但发现语义相似度却比较困难。在本文中,我们提出了一种利用测试代码中存在的独特特征来检测语义克隆的新方法。我们在Apache Commons Math Library的测试套件上演示了我们的方法可以检测259个语义克隆,其中只有54个被NiCad检测到。这证实了在测试代码中研究语义克隆既可行又值得。