基于代码变更与历史信息的测试用例优先级排序OA
Test Case Prioritization Based on Code Changes and Historical Information
现有测试用例优先级排序方法常依赖单一的数据源或分析技术,无法全面捕捉影响测试用例重要性的潜在因素,限制了排序效果.为此,提出一种基于代码变更与历史信息的测试用例优先级排序框架SSH-TCP.首先,在粗粒度过滤阶段通过信息检索模型得到候选测试用例集;其次,在细粒度排序阶段利用预训练语言模型、基于抽象语法树的中心性分析,分别计算代码变更和测试用例的语义与语法相似度;最后,结合测试用例的平均历史失败率确定最终的排序结果.实验表明,SSH-TCP在考虑成本的平均故障检测率指标上优于所有基线模型,验证了所提框架在提升测试用例优先级排序效果方面的有效性.
The existing methods for prioritizing test cases often rely on a single data source or analysis technique,which cannot fully capture the potential factors that affect the importance of test cases and limits the effectiveness of the ranking.To this end,a test case prioritization framework SSH-TCP based on code changes and historical information is proposed.Firstly,in the coarse-grained filtering stage,a candidate test case set is obtained through an information retrieval model;Secondly,in the fine-grained sorting stage,pre trained language models and centrality analysis based on abstract syntax trees are used to calculate the semantic and syntactic similarity of code changes and test cases,re-spectively;Finally,the final ranking result is determined based on the average historical failure rate of the test cases.The experiment shows that SSH-TCP outperforms all baseline models in terms of average fault detection rate considering cost,verifying the effectiveness of the pro-posed framework in improving the prioritization of test cases.
李晋英;刘峰;罗远哲;刘瑞景
北京交通大学 计算机科学与技术学院,北京 100044北京交通大学 计算机科学与技术学院,北京 100044北京中超伟业信息安全技术股份有限公司,北京 100193北京中超伟业信息安全技术股份有限公司,北京 100193
信息技术与安全科学
测试用例排序代码变更语义相似度语法相似度历史失败率
test case prioritizationcode changessemantic similaritysyntactic similarityhistorical failure rate
《软件导刊》 2026 (1)
75-82,8
铁路轨道在轨安全检测大数据系统开发与验证项目(ZCWY-NB-CG-20231116-220)云测试软件系统开发与验证项目(ZCWY-NB-CG-20240730-145)
评论