一句话:首次实证研究测试代码中的继承及其导致的冗余测试执行,并提出静态与动态分析结合的识别定位方法。
该论文关注面向对象测试代码中的继承问题:继承虽促进复用,却可能使子类继承的测试用例被重复执行,造成冗余并降低测试效率。作者首次对测试继承的普遍性与特征进行实证研究,并提出一种结合静态分析与动态分析的混合方法,用于识别和定位由继承引起的冗余测试用例。对实际项目的评估发现:继承在测试代码中被广泛使用;继承导致的冗余测试执行占全部执行测试用例的13%;绕过这些冗余可减少约14%的测试执行时间。研究还指出需要谨慎重构以减少冗余测试,并呼吁进一步关注测试代码质量。
Inheritance, a fundamental aspect of object-oriented design, has been leveraged to enhance code reuse and facilitate efficient software development. However, alongside its benefits, inheritance can introduce tight coupling and complex relationships between classes, posing challenges for software maintenance. Although there are many studies on inheritance in source code, there is limited study on using inheritance in test code. In this paper, we take the first step by studying inheritance in test code, with a focus on redundant test executions caused by inherited test cases. We empirically study the prevalence of test inheritance and its characteristics. We also propose a hybrid approach that combines static and dynamic analysis to identify and locate inheritance-induced redundant test cases. Our findings reveal that (1) inheritance is widely utilized in the test code, (2) inheritance-induced redundant test executions are prevalent, accounting for 13% of all execution test cases, (3) bypassing these redundancies can help reduce 14% of the test execution time, and finally, (4) our study highlights the need for careful refactoring decisions to minimize redundant test cases and identifies the need for further research on test code quality.