针对已有测试用例选择方法在提高错误定位有效性方面存在局限性的问题,首先,定义“失效覆盖向量相似度优先排序”准则,将执行路径与失效执行路径相似的成功测试用例赋予较高的优先级;然后定义“失效覆盖等价划分优化选择”准则,选择能够最大区分失效执行语句的成功测试用例集合;在此基础上,建立测试用例优选模型(effective selection,ES).不同于已有方法,ES充分利用失效执行路径来提高错误定位的有效性.该模型被应用于优选Siemens测试用例集合,其结果被应用于Tarantula等4种错误定位方法,结果表明,ES在约简率Reduction和衡量错误定位有效性的Expense_increase两个指标方面,均优于已有的基于语句和基于向量的测试用例约简方法.ES不但可以获得97%以上的约简率,提高错误定位的效率,而且具有较低的Expense_increase,显著提高了错误定位的有效性.
Existing approaches to test case selection usually focus on how to improve the efficiency of testing,rather than the effectiveness of fault localization.To solve this problem,a test case selection approach is proposed.Firstly,"test case prioritization criterion by similarity of failure coverage vector" is proposed to prioritize the passed test case whose execution path is more similar to that of the failed test case.Secondly,"test case selection criterion by equivalent failure coverage division" is defined to select passed test cases,which can maximally differentiate the statements in the failure execution path.Finally,the test case selection model ES is created based on these two criteria.Different from existing approaches,ES takes advantage of the execution path of the failed test case to improve the effectiveness of fault localization.It has been applied to analyze the Siemens benchmark,and the selected test cases have been used as input of four popular coverage-based fault localization techniques.Experimental results show that in terms of the Reduction and Expense_increase metrics,ES is better than the existing statement-based and vector-based test case reduction approaches.ES can get a Reduction of over 97%,which indicates that it can greatly improve the efficiency of fault localization.In particular,ES can also achieve a low Expense_ increase,which means it can significantly improve the effectiveness of fault localization.